public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Signal SIGCHLD does not interrupt process blocked on read of pipe?
@ 1998-01-12 17:26 Anthony Tuininga
  0 siblings, 0 replies; 3+ messages in thread
From: Anthony Tuininga @ 1998-01-12 17:26 UTC (permalink / raw)
  To: gnu-win32

> I have a process which accepts requests from an Oracle database and
> passes them off to a process via Oracle's "pipe" mechanism. This
> process passes the information to another process which manages the
> requests and processes them. What is happening is that the second
> process spawns a process to handle the request and then goes back to
> reading the pipe. The spawned process completes and becomes <defunct>
> in the process listing but the SIGCHLD handler does not get triggered!
> A subsequent call (which causes the read on the pipe to terminate)
> causes the SIGCHLD handler to trigger and then does exactly the same
> thing!! This is really frustrating. Does anyone have any idea as to
> what is going on?
> 
> This is Windows NT 4.0 Workstation SP3 with cygwin32 beta 18 with the
> coolview patches by Sergey (latest version which I got today).
> 
> Thanks in advance for any help/suggestions,
> Anthony Tuininga
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Signal SIGCHLD does not interrupt process blocked on read of pipe?
  1998-01-12 20:11 Anthony Tuininga
@ 1998-01-15 15:16 ` Tim Newsham
  0 siblings, 0 replies; 3+ messages in thread
From: Tim Newsham @ 1998-01-15 15:16 UTC (permalink / raw)
  To: Anthony Tuininga; +Cc: gnu-win32

> 
> I have a process which accepts requests from an Oracle database and
> passes them off to a process via Oracle's "pipe" mechanism. This
> process passes the information to another process which manages the
> requests and processes them. What is happening is that the second
> process spawns a process to handle the request and then goes back to
> reading the pipe. The spawned process completes and becomes <defunct>
> in the process listing but the SIGCHLD handler does not get triggered!
> A subsequent call (which causes the read on the pipe to terminate)
> causes the SIGCHLD handler to trigger and then does exactly the same
> thing!! This is really frustrating. Does anyone have any idea as to
> what is going on?

Signals do not interrupt blocking operations on pipes and sockets
in cygwin (there may be other blocking calls that do not yield
to signals as well).  This is because cygwin does a blocking call
into NT and gives up control of the thread until the call returns.
The cygwin signal mechanism causes the thread to stop, fiddles
with its stack, and then resumes the thread.  This means the signal
doesn't get delivered until the blocking call returns.

(Signal stuff is gonna change soon (or has already?) but I assume
the blocking behavior will remain the same).

As a work around you can use sockets instead of pipes, and make
sure to use only non-blocking socket calls (select() gets along
fine with signals).  You can patch your cygwin.dll to only
do non-blocking socket calls if you can't or don't want to patch
all of your sources. 

> Anthony Tuininga

                                          Tim N.

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Signal SIGCHLD does not interrupt process blocked on read of pipe?
@ 1998-01-12 20:11 Anthony Tuininga
  1998-01-15 15:16 ` Tim Newsham
  0 siblings, 1 reply; 3+ messages in thread
From: Anthony Tuininga @ 1998-01-12 20:11 UTC (permalink / raw)
  To: 'gnu-win32@cygnus.com'

I have a process which accepts requests from an Oracle database and
passes them off to a process via Oracle's "pipe" mechanism. This
process passes the information to another process which manages the
requests and processes them. What is happening is that the second
process spawns a process to handle the request and then goes back to
reading the pipe. The spawned process completes and becomes <defunct>
in the process listing but the SIGCHLD handler does not get triggered!
A subsequent call (which causes the read on the pipe to terminate)
causes the SIGCHLD handler to trigger and then does exactly the same
thing!! This is really frustrating. Does anyone have any idea as to
what is going on?

This is Windows NT 4.0 Workstation SP3 with cygwin32 beta 18 with the
coolview patches by Sergey (latest version which I got today).

Thanks in advance for any help/suggestions,
Anthony Tuininga

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1998-01-15 15:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-01-12 17:26 Signal SIGCHLD does not interrupt process blocked on read of pipe? Anthony Tuininga
1998-01-12 20:11 Anthony Tuininga
1998-01-15 15:16 ` Tim Newsham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).