none
Multiple NdisWaitEvent calls waiting for a single event RRS feed

  • Question

  • Is it ok to have several pieces of code running in parallel and invoking NdisWaitEvent to wait for the same event to be signaled? Upon event signalling will the wait be satisfied for all of the waits?

    Tuesday, May 21, 2013 1:39 PM

Answers

  • Yes it is ok for multiple NdisWaitEvent calls to be on a single event.  NDIS creates events as NotificationEvent (if you look at http://msdn.microsoft.com/en-us/library/windows/hardware/ff543006(v=vs.85).aspx you can get a better explanation.  Many of the NDIS calls are simple wrappers around kernel API's, they are there primarily to create a portable layer for NDIS.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    • Marked as answer by -IgorC- Tuesday, May 21, 2013 2:09 PM
    Tuesday, May 21, 2013 1:48 PM

All replies

  • Yes it is ok for multiple NdisWaitEvent calls to be on a single event.  NDIS creates events as NotificationEvent (if you look at http://msdn.microsoft.com/en-us/library/windows/hardware/ff543006(v=vs.85).aspx you can get a better explanation.  Many of the NDIS calls are simple wrappers around kernel API's, they are there primarily to create a portable layer for NDIS.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    • Marked as answer by -IgorC- Tuesday, May 21, 2013 2:09 PM
    Tuesday, May 21, 2013 1:48 PM
  • to clarify don's answer

    a synchronization even will wake up one waiter when the event is set (if there are multiple waiters, there is no defined order in which will be woken up). once the wait is satisfied, the event returns to the non signaled state.  for a notification event, the event remains in the signaled state after the wait has been satisfied, that means that you must manually return the event back to the non signaled state on your own and properly handle that state change so you don't introduce race conditions.


    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, May 21, 2013 5:49 PM