Charles-François Natali <neolo...@free.fr> added the comment:

> The C signal handler is called, but the system call (read in this case)
> is not interrupted.

That's what I thought...

> Bad news: the script doesn't hang if Python is build without threads.

Makes sense. When linked with pthread, all I/O syscalls are actually 
non-blocking.

> read() is interrupted after 1 second, it works.

Hmmm...
Does it still work if you don't a create thread beforehand?

Also, one difference is that Python uses sigaction to setup the signal handler. 
There might be subtle semantics change/bugs between signal/sigaction.

> Oh, siginterrupt(SIGALRM, 0) doesn't work in a program linked to
> pthread.

You could try with sigaction/SA_RESTART.

But OpenBSD's pthread implementation has severe limitations/bugs.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12905>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to