Top "Blockingqueue" questions

A queue data structure that that waits (suspends the current thread) for the queue to become non-empty when retrieving an element and for space to become available in the queue when storing an element.

Is adding tasks to BlockingQueue of ThreadPoolExecutor advisable?

The JavaDoc for ThreadPoolExecutor is unclear on whether it is acceptable to add tasks directly to the BlockingQueue backing the …

java concurrency producer-consumer executorservice blockingqueue
How long a blocking queue will wait for an element to dequeue?

I'm using a blocking queue implementaion in my program.I would like to konw how long the thread will wait …

java blockingqueue
Wait until a BlockingCollection queue is cleared by a background thread, with a timeout if it takes too long?

In C#, I'm wondering if it's possible to wait until a BlockingCollection is cleared by a background thread, with a …

c# .net blockingqueue blockingcollection
Equivalent of golang channel in Java

I have a requirement where I need to read from a set of Blocking queues. The blocking queues are created …

java multithreading concurrency go blockingqueue
How to immediately release threads waiting on a BlockingQueue

Consider a BlockingQueue and a few threads waiting on poll(long, TimeUnit) (possibly also on on take()). Now the queue …

java concurrency blockingqueue
Thread-safety of BlockingQueue's drainTo() method

Documentation of BlockingQueue says bulk operations are not thread-safe, though it doesn't explicitly mention the method drainTo(). BlockingQueue implementations are …

java thread-safety blockingqueue