[Python-ideas] Thread IPC idea: Quipe? Sockqueue? (Re: Python and Concurrency)

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Mar 29 04:27:10 CEST 2007

I was thinking about thread killing, and why we
think it's okay to kill OS processes but not

Killing an OS process is unlikely to cause other
processes with which it's communicating to hang,
since closing one end of a pipe or socket causes
anything on the other end to get EOF on reading
or a signal or error on writing.

But the way threads usually communicate, using
locks and queues, means that it's easy for a
thread to get hung up waiting for something that
another thread is supposed to do, but won't,
because it's been killed.

So I'm wondering if we want something for inter-
thread communication that works something like a
cross between a queue and a pipe. It knows what
threads are connected to it, and if all threads
on one end exit or get killed, threads on the
other end find out about it.

We could call it a Quipe or Sockqueue or Quocket
(or if we want to be boring, a Channel).

This would probably have to be hooked into the
threads implementation at a low level, since it
would need to be able to detect the death of
a thread by any means, without relying on any
cooperation from the user's code.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | Carpe post meridiem!          	  |
Christchurch, New Zealand	   | (I'm not a morning person.)          |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+

More information about the Python-ideas mailing list