Re: C replacement for Queue module

2005-10-23 Thread Peter Hansen
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

Re: C replacement for Queue module

2005-10-22 Thread Peter Hansen
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

Re: C replacement for Queue module

2005-10-22 Thread Jason Lai
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

C replacement for Queue module

2005-10-21 Thread Jonathan Ellis
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

Re: C replacement for Queue module

2005-10-21 Thread Jason Lai
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

Re: C replacement for Queue module

2005-10-21 Thread jepler
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

Re: C replacement for Queue module

2005-10-21 Thread Jonathan Ellis
[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