multiprocessing signal defect

Adam Tauno Williams awilliam at whitemice.org
Fri Oct 29 10:40:52 EDT 2010


On Fri, 2010-10-29 at 07:31 -0700, Jean-Paul Calderone wrote: 
> On Oct 29, 10:08 am, Adam Tauno Williams <awill... at whitemice.org>
> wrote:
> > signal handler to do something smart in the case of a "-15" [for which
> > there isn't really a thread equivalent - can you sent a SystemV style
> > signal to an individual thread in a process?  I don't think so.]
> Yes.  pthread_kill(P)

Eh, only sort of.

<quote>
Signal dispositions are process-wide: if a signal handler is installed,
the handler will be invoked in the thread thread, but if the disposition
of the signal is "stop", "continue", or "terminate", this action will
affect the whole process.
</quote>

Also phthread_kill can only be called for a thread in the same process.
Which is quite different that SystemV signals.

So there can't really be an exact 1:1 match of how thread-signaling vs.
multiprocessing-process-signaling works; which was my point.




More information about the Python-list mailing list