java.util.concurrency - Java Concurrency Utilities
- Java Concurrency Utilities - java.util.concurrent
- Java BlockingQueue
- ArrayBlockingQueue
- DelayQueue
- LinkedBlockingQueue
- PriorityBlockingQueue
- SynchronousQueue
- BlockingDeque
- LinkedBlockingDeque
- ConcurrentMap
- ConcurrentNavigableMap
- CountDownLatch
- CyclicBarrier
- Exchanger
- Semaphore
- Java ExecutorService
- Java Callable
- Java Future
- ThreadPoolExecutor
- ScheduledExecutorService
- Java Fork and Join using ForkJoinPool
- Java Lock
- ReadWriteLock
- AtomicBoolean
- AtomicInteger
- AtomicLong
- AtomicReference
- AtomicStampedReference
- AtomicIntegerArray
- AtomicLongArray
- AtomicReferenceArray
SynchronousQueue
Jakob Jenkov |
The SynchronousQueue
class implements the BlockingQueue
interface.
Read the BlockingQueue
text for more information about the interface.
The SynchronousQueue
is a queue that can only contain a single element internally.
A thread inseting an element into the queue is blocked until another thread takes that element from the queue.
Likewise, if a thread tries to take an element and no element is currently present, that thread is blocked
until a thread insert an element into the queue.
Calling this class a queue is a bit of an overstatement. It's more of a rendesvouz point.
Next: BlockingDeque
Tweet | |
Jakob Jenkov |