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
LinkedBlockingDeque
Jakob Jenkov |
The LinkedBlockingDeque
class implements the BlockingDeque
interface.
Read the BlockingDeque
text for more information about the interface.
The word Deque
comes from the term "Double Ended Queue". A Deque
is thus a queue where
you can insert and remove elements from both ends of the queue.
The LinkedBlockingDeque
is a Deque
which will block if a thread attempts to take
elements out of it while it is empty, regardless of what end the thread is attempting to take elements from.
Here is how to instantiate and use a LinkedBlockingDeque
:
BlockingDeque<String> deque = new LinkedBlockingDeque<String>(); deque.addFirst("1"); deque.addLast("2"); String two = deque.takeLast(); String one = deque.takeFirst();
Next: ConcurrentMap
Tweet | |
Jakob Jenkov |