threading : make stop the caller

Lie Ryan lie.1296 at gmail.com
Sun Jun 19 13:04:07 EDT 2011


On 06/20/11 02:52, Laurent Claessens wrote:
> 
>> Popping task off the end of the list is more efficient:
> 
>> while task_list:
>>     task_list.pop().start()
> 
> That's cool. In my case it's better to do
> task_list.pop(0).start
> 
> in order to pop the first element.

then you really wanted a queue instead of a list.

There is a thread-safe `queue` module in the standard library.



More information about the Python-list mailing list