On 02/05/12 17:13, Lion Chen wrote:
i have read it, as the "Answer" said, seems like deque is not
thread-safe either, because deque has the operator +=, and others like
that.
I'm no expert and have never used dequeue.
But I notice the documentation says:
"""Deques are a generalization of stacks and queues... Deques support
thread-safe, memory efficient appends and pops from either side of the
deque with approximately the same O(1) performance in either direction."""
So only append() and pop() are listed as being thread safe. If you use
any other operation I read that as being a risk.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor