Re: Shared memory between kernel driver and multiple processes
- From: "Sue Loh [MS]" <sloh@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 15 Nov 2006 17:47:25 -0500
It sounds like memory mapped files are exactly what you need here. One best
practice I'd attach to that recommendation is, don't pass pointers around
between processes. (Don't store pointers inside the memory-mapped file
either.) Instead use offsets. That way, if the view is loaded at different
addresses in different processes, your code will still work.
To add to what Dean said -- VirtualAllocCopyEx can copy from virtual
addresses. And VirtualAllocCopyEx (unlike VirtualCopy[Ex]) will take care
of cache coherency for you. On virtually tagged ARM CPUs it will cause the
source and destination of the copy to be uncached until the copy is freed.
That prevents cache coherency problems, but it could lead to performance
problems if your program is really sensitive to memory access speed.
[Underneath the covers, memory mapped files will do the same thing actually]
In general, I would say VirtualAllocCopyEx is not something to use unless it
is clearly your only option.
Sue
sloh@xxxxxxxxxxxxx (remove "online" from reply-to address)
http://blogs.msdn.com/ce_base/
_____________________________________________________________
This posting is provided "AS IS" with no warranties, and confers no rights.
_____________________________________________________________
.
- Follow-Ups:
- Re: Shared memory between kernel driver and multiple processes
- From: Olivier M
- Re: Shared memory between kernel driver and multiple processes
- References:
- Shared memory between kernel driver and multiple processes
- From: Olivier M
- Re: Shared memory between kernel driver and multiple processes
- From: voidcoder
- Re: Shared memory between kernel driver and multiple processes
- From: Dean Ramsier
- Shared memory between kernel driver and multiple processes
- Prev by Date: Re: How to get USB / Ethernet (NIC) working on MS Windows CE 5.0 ?
- Next by Date: Re: How to get USB / Ethernet (NIC) working on MS Windows CE 5.0 ?
- Previous by thread: Re: Shared memory between kernel driver and multiple processes
- Next by thread: Re: Shared memory between kernel driver and multiple processes
- Index(es):