Queues - Is Infinity all right?
Anand Pillai
pythonguy at Hotpop.com
Sun Oct 5 09:20:56 EDT 2003
The standard Python Queue module, allows to generate queues that
have no size limit, by passing the size argument as <= 0.
q = Queue(0)
In a multithreaded application, these queues could be useful
when you have many threads using the queue for data access
and synchronization.
Is there a performance hit when one uses an 'infinite' queue
when compared to a queue of fixed size?
Of course it should depend upon the O(n) of the Queue data structure,
how the time of access (get/put) varies with the number of items in
it.
I would like to have some light on this. Is it constant, O(n) or
a higher order?
Thanks
-Anand
More information about the Python-list
mailing list