0

Assume that two spawned processes signaling using Win32 Events or semaphore,but When an event has be signal and reset within between 1 to 10 millisecond time interval.Sometimes Event set function - SetEvent failed to signal.

If every ,

SETEvent -> WAITFOSINGLEOBJECT/RESETEVENT -> SETEvent

calls happens rapidly ,

  1. Will Win32 Kernel event or Semaphore objects fails to propagate or signal among each two processes ?
  2. Is there better alternatives to rapid signaling among Windows inter-process?

(One Process is set/reset event other one waiting until signaled) (We can emulate Event behavior using Semaphores using single count)

  • This is basically what `PulseEvent` does and yes it can miss events. See https://blogs.msdn.microsoft.com/oldnewthing/20050105-00/?p=36803 for a discussion on this. – Jonathan Potter Oct 18 '17 at 06:32
  • @JonathanPotter PulseEvent is deprecated right? Is it safe to use PulseEvent ? –  Oct 18 '17 at 09:30
  • @Buddhika - SetEvent not failed. failed only your program logic. use `PulseEvent` is safe. but it not help you by same logic problem – RbMm Oct 18 '17 at 10:20
  • 1
    It is drastically troublesome, you'll almost inevitably have a race condition in your program. You cannot assume that the other thread/process has properly completed the WFSO call. You need two synchronization objects so you can correctly ping-pong back and forth. – Hans Passant Oct 18 '17 at 12:12
  • @HansPassant Process1 which is set the event cannot depend on other process2 wait object, in process1 assume we have a loop and within that it resetting and setting the event for every delta(small duration) millisecond , and procees 2 also spawn a thread and that thread on a loop ,within that loop it wait for signal from process 1 and consecutively do some push back operations and wait again for signal from process 1. what ever happens in process 2 , process 1 should signaling for given time interval,within a cycle of process 1's loop ,process 2 capture a signal and do stuff and wait again. –  Oct 19 '17 at 06:30

0 Answers0