Re: Interprocess Communication & Performance
- From: "Don Burn" <burn@xxxxxxxxxxxxxxxx>
- Date: Sun, 12 Mar 2006 17:57:22 -0500
I guess the first question is how are you going to structure this and how
much data is passing through. For instance if the data items are small and
there is a need for a notification (such as an event) then forget the shared
memory the performance hit from the synchronization will overwhelm things.
There is no "general purpose answer" here without having details of the data
items, the frequency and the synchronization requirements, you are just
guessing.
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply
"Jos Scherders" <thrower@xxxxxxx> wrote in message
news:egGkKZiRGHA.5296@xxxxxxxxxxxxxxxxxxxxxxx
Hi,
In my hypothetical solution I am also avoiding memcpy's because I want
to map the allocated memory in both processes. So there would be no more
memcpy's then using shared file mapping I think. I am however avoiding any
disk IO because of swapping.
It would be interesting to know what others people have done if
performance
is paramount.
Jos.
"Skywing" <skywing_NO_SPAM_@xxxxxxxxxxxxxxxxxxx> wrote in message
news:ugs0ILiRGHA.336@xxxxxxxxxxxxxxxxxxxxxxx
I would go for a shared file mapping - you eliminate lots of memcpy's that
way.
(Just because it is "pagefile backed" doesn't mean that it will be
continually paged out - think of it like any other VM you allocate, which
might be paged out if the system is under memory pressure or it becomes
unused for an extended period of time.)
"Jos Scherders" <thrower@xxxxxxx> wrote in message
news:%23y%23%230ohRGHA.5908@xxxxxxxxxxxxxxxxxxxxxxx
Hi,
I know these API's, they are all documented in
MSDN, but that does not answer the question.
The question is, is allocating and mapping
allocated memory myself faster then using the
file mapping stuf or is not worth the trouble. My
thought was that avoiding flushing memory to the
swap file and reading it back could be avoided and
therefore would be faster.
Any idea's ?
Jos.
"Kellie Fitton" <KELLIEFITTON@xxxxxxxxx> wrote in message
news:1142119554.874839.157820@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
Use the following APIs to allocate memory in the address space
of another process:
VirtualAllocEx()
VirtualFreeEx()
Additionally, you can use he following APIs to create shared
memory in IPC:
CreateFileMapping()
OpenFileMapping()
MapViewOfFileEx()
UnmapViewOfFile()
FlushViewOfFile()
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/memory/base/virtualallocex.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/memory/base/virtualfreeex.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/createfilemapping.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/openfilemapping.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/mapviewoffileex.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/unmapviewoffile.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/flushviewoffile.asp
Hope these suggestions helps,
Kellie.
.
- References:
- Interprocess Communication & Performance
- From: Jos Scherders
- Re: Interprocess Communication & Performance
- From: Jos Scherders
- Re: Interprocess Communication & Performance
- From: Skywing
- Re: Interprocess Communication & Performance
- From: Jos Scherders
- Interprocess Communication & Performance
- Prev by Date: Re: Interprocess Communication & Performance
- Next by Date: Re: Interprocess Communication & Performance
- Previous by thread: Re: Interprocess Communication & Performance
- Next by thread: Re: Interprocess Communication & Performance
- Index(es):
Relevant Pages
|