Mail Archives: cygwin-developers/1998/06/15/10:58:15
> Now that I answered your question, how about answering this one: Imagine
> that, instead of a pause() the program was doing a blocking socket
> operation that lasted at least 10 seconds. What would happen when the
> SIGALRM occurred?
I believe this is already the case. When a signal comes in, if there
is a handler, the handler just gets pushed on the stack. The handler
doesnt get invoked until the (blocking) call completes. It's only
when the handler is not set and the process should exit that WSACleanup
is called before pushing the do_exit address onto the stack. This
forces (or is supposed to at least) the socket operation to stop early
and invoke the handler (always do_exit) in a timely manner.
So, if do_exit was called directly rather than using WSACleanup
and call_handler(), it would seem that the end result would be the
same as current behavior: handlers wouldn't get run until blocking
calls complete, except for implicit exit handlers which would run
immediately.
> cgf
Tim N.
- Raw text -