Jason Lai wrote:
As far as Queues go, the adding/popping is apparently done with deque
which are implemented in C. The Queue class pretty much just provides
blocking operations and is otherwise a very thin layer around deque. As
far as primitives go, only threading.Lock is written in C and the
Jonathan Ellis wrote:
I'm working on an application that makes heavy use of Queue objects in
a multithreaded environment.
By heavy I mean millions of calls to put and get, constituting ~20%
of the app's run time. The profiler thinks that a significant amount
of time is spent in this code
As far as Queues go, the adding/popping is apparently done with deque
which are implemented in C. The Queue class pretty much just provides
blocking operations and is otherwise a very thin layer around deque. As
far as primitives go, only threading.Lock is written in C and the
others are pure
I'm working on an application that makes heavy use of Queue objects in
a multithreaded environment.
By heavy I mean millions of calls to put and get, constituting ~20%
of the app's run time. The profiler thinks that a significant amount
of time is spent in this code -- not just a consumer
How about Python 2.4's collections.deque class? Supposedly it's
thread-safe, and it's implemented in C.
- Jason
--
http://mail.python.org/mailman/listinfo/python-list
does collections.deque have a blocking popleft()? If not, it's not very
suitable to replace Queue.Queue.
Jeff
pgp9S3BEmciKx.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
does collections.deque have a blocking popleft()? If not, it's not very
suitable to replace Queue.Queue.
It does not.
-Jonathan
--
http://mail.python.org/mailman/listinfo/python-list