Will python ever have signalhandlers in threads?

Peter Hansen peter at engcorp.com
Mon Nov 15 06:12:31 EST 2004


Antoon Pardon wrote:
> AFAIU the Queue module doesn't block on a full/empty queue when
> a timeout is specified but goes in a loop sleeping and periodically
> checking whether place/items are available. With signals that
> can be sent to a thread the queue could just set an alarm and
> then block as if no timeout value was set and either unblock
> when place/items are available or get signalled when the timeout
> period is over.

I'm fairly sure that the Queue uses an internal Event
(or REvent?) to signal when space or a new item is
available, so I believe your description (and possibly
conclusion) above is wrong.  There should be no
"periodical check", as that would imply polling.  Check
the source if you're interested.

-Peter



More information about the Python-list mailing list