In Java Concurrency In Practice book (p.156), there’s a statement regarding poison pill approach:
Poison pills work reliably only with unbound queues.
Does it mean that with a bounded queue I can get a deadlock, or is it about some other liveness problems?
Is it connected with number of producers and customers?
With a bounded queue, you could be prevented from adding the poison pill.
One way to avoid this issue is to make the bounded queue allow one more when a poison pill is added.