How to kill a thread?

Antoon Pardon apardon at
Mon Jun 9 13:40:54 CEST 2008

On 2008-06-07, David <wizzardx at> wrote:
> Would it be possible for a 3rd-party threading library to an
> 'interruptible' version of Queue?
> The same methods as the normal Queue, but when you call a new .kill()
> method on the queue, all the threads locking on the queue get a
> "QueueKilled" exception thrown.

I have done something similar. The idea was that threads had to open
a queue before they could access it. If the last thread who had the
queue open in write mode, closed the queue, a reader trying to get
an element from an empty queue would have an "EOInformation" exception

Antoon Pardon

More information about the Python-list mailing list