[Pythonmac-SIG] Thread not unblocked by socket's accept, recv

Rick Lee rwklee@home.com
Sat, 20 Jan 2001 15:28:03 -0500


Hi,

I am running MacPython 2.0 on MacOS 8.5.1.

After much experimentation, I come to the conclusion that on my machine,
a thread does not get unblocked by a socket's accept() method, even when
a condition to cause the unblocking has occurred.  Same thing with a
socket's recv() method.  I have this thread running inside a .py file,
which is executed with an execfile command in the interpreter.

Is this intended behaviour, a limitation, or a bug?  Is there a
workaround?

Note, same thing also happens with time.sleep(); so it leads me to
believe that this problem is not limited to sockets.  Some other
experimentation also leads to this conclusion: if a thread is blocked by
time.sleep(), some other code calling time.sleep() will unblock this
thread.  I have a hunch this would also with the above socket's methods;
but I have not set up this experiment.

Thanks.

- Rick Lee