Re: Shared Memory Creation



And for an 8k area, it is probably a heck of a lot faster and safer not to
use shared memory at all. Use IOCTL's for the communication they are simple
and reliable, and plenty fast for this size of data.

If you use memory mapping, you are far from the norm. You have to worry
about how you are going to deal with the application failing (I have seen
drivers that hang because the application died), and a lot of pesky details
to get synchronization correct.

If you use IOCTL's with DIRECT_XXX access method the kernel will map the
pages of your buffer from user to kernel, there is not copying. If the
application fails, the IRP is canceled, so you get notification.

Bottom line there are few cases where having a shared memory region between
a driver and an application make sense, I have never seen one that was less
than megabytes.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
http://www.windrvr.com
Remove StopSpam from the email to reply



"Vladimir Zinin" <vzinin@xxxxxxxxx> wrote in message
news:%23uNUphy0GHA.3464@xxxxxxxxxxxxxxxxxxxxxxx
Mutex, events (see for ex. ZwCreateEvent).
But probably the IOCTL mechanism is more appropriate for your purposes...

--
Best regards,
Vladimir Zinin
mailto:vzinin@xxxxxxxxx

Chin wrote:
Hi Vladimir,
I manually added the proto in the header file. Its
working,
May I know further how to synchronise betn the appln and
driver as driver has to wait but appln is writing data continuously,
how will the appln know to to stop and proceed. Does having a flag in
shared memory help ?

Thanks and Regards,
Chin


.



Relevant Pages

  • Re: SHaring buffer from kernel to applications-help!!!
    ... Sharing memory is a bad idea in most cases. ... Problems when you want to expand or contract the buffer area. ... I've worked on projects where we used shared memory (delivering streaming ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ...
    (microsoft.public.development.device.drivers)
  • Re: Shared Memory Creation
    ... May I know further how to synchronise betn the appln and ... driver as driver has to wait but appln is writing data continuously, ... I am trying to create shared memory from the driver Using ...
    (microsoft.public.development.device.drivers)
  • Re: sharing memory with user and kernel
    ... handle the problems of the user mode application going away or the driver ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ... the data in shared memory using CreateFileMapping and MapViewOfFile. ... working on a virtual mic driver and my ...
    (microsoft.public.development.device.drivers)
  • Re: sharing memory with user and kernel
    ... handle the problems of the user mode application going away or the driver ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ... the data in shared memory using CreateFileMapping and MapViewOfFile. ... working on a virtual mic driver and my ...
    (microsoft.public.development.device.drivers)
  • Re: [PATCH 7/8] s390: new DCSS SHM device driver
    ... On Dinsdag 28 Dezember 2004 09:28, Heiko Carstens wrote: ... > Add support for shared memory using z/VM DCSS. ... I'd rather not see this driver merged at this point. ...
    (Linux-Kernel)