[421] in Pthreads mailing list archive
Signals problem
daemon@ATHENA.MIT.EDU (Chris Colohan)
Thu Sep 26 00:19:06 1996
From: Chris Colohan <colohan@eecg.toronto.edu>
To: pthreads@MIT.EDU
Date: Thu, 26 Sep 1996 00:05:53 -0400
I was wondering if anyone has been archiving the bugs and patches
reported on this list, and has an area on the net where I can obtain
an absolutely up to date version of pthreads, since the officially
released version has not been refreshed in a while, and a number of
bug reports have appeared on this mailing list.
Why am I asking this? Because I am having a problem with signals, and
from the postings I have reviewed in the mailing list archive it
appears that I am not alone, but I am not sure if this problem has
been solved yet. So I will describe what is happening to me, and
hopfully someone can tell me if my problem has been solved, or give me
some insight as to how to fix this.
My machine: Pentium PC, running Linux 2.0.17 (Red Hat 3.0 + new
kernel), 32MB RAM, etc.
I am writing an application that is to do asynchronous I/O through
sockets. So I create a socket, bind it, and set up a signal handler
to handle SIGIO. Now this configuration works fine, messages are
happily transmitted machines until the following occurs:
When all of the threads in a process are blocked on a mutex (waiting
for a message to be received so my signal handler will unblock them),
pthreads notices that no threads are running and suspends the process
by calling sig_handler_pause(). The problem is that once it has
called that function, nothing seems to wake up the process, including
receiving a new packet at the socket. So my program blocks waiting
for SIGIO, and then pthreads shuts down and never gets the signal to
pass on to my program.
I have looked at this extensively under the debugger, and I can't
figure out when the pthread kernel blocks out SIGIO before going to
sleep. Could someone with more knowledge of how pthreads works give
me a hint?
Thanks!
Chris