How to interrupt a BlockingQueue which is blocking on take()?
If interrupting the thread is not an option, another is to place a “marker” or “command” object on the queue that would be recognized as such by MyObjHandler and break out of the loop.
If interrupting the thread is not an option, another is to place a “marker” or “command” object on the queue that would be recognized as such by MyObjHandler and break out of the loop.
How can I work around this limitation in ThreadPoolExecutor where the queue needs to be bounded and full before more threads will be started. I believe I have finally found a somewhat elegant (maybe a little hacky) solution to this limitation with ThreadPoolExecutor. It involves extending LinkedBlockingQueue to have it return false for queue.offer(…) when … Read more