Hi Corinna,

>Since your example code is running very tightly most of its time inside
>some Windows system DLL function, there's next to no chance to interrupt
>the thread to inject the signal handler call.  Cygwin tries this 100
>times per signal.  If that fails, the signal gets lost.
>
>One way to solve this problem is adding a Cygwin call into the loop,
>like the aforementioned usleep.  When a Cygwin call is performed, the
>signal handler will be called as soon as the Cygwin call returns to
>user-space.
>
>The bottom line is, Cygwin user space signal handlers and lots of
>Windows-only calls in a tight loop don't work nicely together.

Ok, thanks for the explanation. In the real application, there is some
actual processing inside the loop, besides the call to PeekMessage and more
signals get through (Probably 75%), I just cut the code down to make a
simpler test case. I'll add a Cygwin call as suggested.

Cheers,
Jon

--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to