threads and concurrency queue([maxsize]creates shared process queue maxsize is the maximum number of items allowed in the queue if omittedthere is no size limit the underlying queue is implemented using pipes and locks in additiona support thread is launched in order to feed queued data into the underlying pipe an instance of queue has the following methodsq cancel_join_thread(don' automatically join the background thread on process exit this prevents the join_thread(method from blocking close(closes the queuepreventing any more data from being added to it when this is calledthe background thread will continue to write any queued data not yet written but will shut down as soon as this is complete this method is called automatically if is garbage-collected closing queue does not generate any kind of end-of-data signal or exception in queue consumers for exampleif consumer is blocking on get(operationclosing the queue in the producer does not cause the get(to return with an error empty(returns true if is empty at the time of the call if other processes or threads are being used to add queue itemsbe aware that the result is not reliable ( new items could have been added to the queue in between the time that the result is returned and usedq full(returns true if is full the result is also not reliable due to threads (see empty() get([block [timeout]]returns an item from if is emptyblocks until queue item becomes available block controls the blocking behavior and is true by default if set to falsea queue empty exception (defined in the queue library moduleis raised if the queue is empty timeout is an optional timeout to use in blocking mode if no items become available in the specified time intervala queue empty exception is raised get_nowait(the same as get(falseq join_thread(joins the queue' background thread this is used to wait for all queue items to be consumed after close(has been called this method gets called by default in all processes that are not the original creator of this behavior can be disabled by called cancel_join_thread( put(item [block [timeout]]puts item onto the queue if the queue is fullblock until space becomes available block controls the blocking behavior and is true by default if set to falsea queue full exception (defined in the queue library moduleis raised if the queue is full timeout specifies how long to wait for space to become available in blocking mode queue full exception is raised on timeout lib fl ff