Is Queue.Queue.queue.clear() thread-safe?

Fredrik Lundh fredrik at pythonware.com
Thu Jun 22 17:48:35 EDT 2006


Tim Peters wrote:

>> I'm guessing no, since it skips down through any Lock semantics,
> 
> Good guess :-)  It's also unsafe because some internal conditions must
> be notified whenever the queue becomes empty (else you risk deadlock).

"also" ?  if it weren't for the other things, the clear() call itself 
would have been atomic enough, right ?

</F>




More information about the Python-list mailing list