In brief
queue.Queue provides a synchronized queue for producers and consumers. maxsize can bound pending work instead of accepting input without a limit.
Useful to know
queue.Queue provides a synchronized queue for producers and consumers. maxsize can bound pending work instead of accepting input without a limit. [1]
When using task_done(), account for every retrieved task on the appropriate path, including failures. Otherwise join() may keep waiting. The queue organizes transfer but does not itself define a retry policy.
Sources
For further detail and to check the information: