When using a multiprocessing.Queue to share data between processes, what happens if the queue is full and you use the put() method without a timeout?
Trap 1: It restarts the child process.
There is no mechanism for a queue to restart a process.
Trap 2: It raises a Full exception immediately.
This only happens if block=False is set.
Trap 3: It silently drops the data.
Queue operations do not silently drop data.
- A
It restarts the child process.
Why wrong: There is no mechanism for a queue to restart a process.
- B
It blocks indefinitely until a slot becomes available.
Default behavior of put() is to block if the queue is full.
- C
It raises a Full exception immediately.
Why wrong: This only happens if block=False is set.
- D
It silently drops the data.
Why wrong: Queue operations do not silently drop data.
- E
It overwrites the oldest item in the queue.
Why wrong: Queue is FIFO, it does not overwrite automatically.