The documentation for python's multiprocesing queue: https://docs.python.org/2/library/multiprocessing.html#multiprocessing.Queue
Isn't as clear as the one for queue.Queue: https://docs.python.org/3/library/queue.html
As to whether or not the size of the queue is "infinite" (as in, within the possible bounds of whatever the program can manage to allocate memory wise) when the maxsize argument isn't given to the constructor.
Is this the case ?
multiprocessing.Queue
mimics queue.Queue
completly with all features (except .task_done()
and .join()
)
Queue implements all the methods of Queue.Queue except for task_done() and join().
So without arguments (or a negative number) it can take infinite elements
(as an side-note since Queues are internally list like structures (dequeue
, heapq
, list
) it is harder to have an limit, then to not have an limit.)
Edit:
Ok as it turns out after looking through the source code, it turns out that multiprocessing.Queue
does have a standard upper bound if no value is specified: 2**31-1
# file multiprocessing/queues.py class Queue(object): def __init__(self, maxsize=0, *, ctx): if maxsize <= 0: from .synchronize import SEM_VALUE_MAX as maxsize # -> 2**31-1
So it is not infinte, but praticly infinte
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With