Queue Classes | Learning More |
How to Use | Links |
Books |
Java Queues classes and interfaces | ||
---|---|---|
Class | Type | Purpose |
Queue | interface | Basic queue interface. Defines the basic methods to add elements to the queue (offer, add), look at the head of the queue (peek, element) or pop the head of the queue off the queue (poll, remove). There are two versions of each method, e.g. offer returns a magic value on trouble and add throws an Exception. Queue is derived from Collection so all the Collection methods are also available. |
BlockingQueue | interface | If the queue is empty, blocks the current thread until some other thread adds an element. You can provide a timeout how long you are prepared to wait. |
AbstractQueue | abstract class | Underpinnings for ArrayBlockingQueue, ConcurrentLinkedQueue, DelayQueue, LinkedBlockingQueue, PriorityBlockingQueue, PriorityQueue, SynchronousQueue. |
ArrayBlockingQueue | class | FIFO blocking queue where the elements are stored in a fixed size array. The array buffer is circular, somtimes called a squirrel cage buffer or hamster buffer. When the array fills up it wraps around to the beginning being careful not to overwrite existing elements. If all goes well, the oldest elements are popped off in time to create room for new elements, hot on their heels. |
ConcurrentLinkedQueue | class | Unbounded (can grow arbitrarily large), FIFO, thread-safe queue. |
DelayQueue | class | Unbounded, sorted by delay, so that elements can be eligible to leave the queue once the delay has expired. The oldest expired delay element pops from the queue first. |
Executors | class | creates thread pools that work off a todo queue. |
LinkedBlockingQueue | class | Optionally bounded, FIFO blocking queue implemented with linked nodes. |
LinkedList | class | Supports List interface, though it is very slow at indexing since it is implemented as linked nodes. |
PriorityBlockingQueue | class | Blocking, sorted queue ordered by natural order Comparable interface or supplied Comparator. Does not permit null elements. Pops the smallest element. |
PriorityQueue | class | Non-blocking, sorted queue ordered by natural order Comparable interface or supplied Comparator. Does not permit null elements. Pops the smallest element. |
SynchronousQueue | class | A dummy queue that can’t even hold one element. Every add to the queue must be matched by an immediate pop before there can be another add. It is for thread to thread handoff. |
ThreadPoolExecutor | class | executes each submitted task using one of possibly several pooled threads. |
![]() |
recommend book⇒Java Concurrency in Practice![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
by | Brian Goetz, Tim Peierls, Joshua J. Bloch, Joseph Bowbeer, David Holmes, Doug Lea | 978-0-321-34960-6 | paperback | |||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
publisher | Addison-Wesley | 978-0-13-270225-6 | eBook | |||||||||||||||||||||||||||||||||||||||||||||||||||||
published | 2006-05-19 | B004V9OA84 | kindle | |||||||||||||||||||||||||||||||||||||||||||||||||||||
Bloch and Lea especially have very good reputations in concurrent programming. This is the dream team to write such a book. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder. |
![]() |
recommend book⇒Concurrent Programming in Java(TM): Design Principles and Patterns, third edition![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
by | Douglas Lea | 978-0-321-25617-1 | paperback | |||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
publisher | Addison-Wesley | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
published | 2006-05-19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Threads and concurrency in Java, design considerations (safety, liveness and performance), Before/After Patterns, layering, adapters, immutability and synchronization, deadlock, resource ordering, the Java Memory Model and concurrency, using the java.concurrency package, confinement, refactoring for concurrency, mutexes, read-write locks, recovering from failure, notifications, semaphores, latches, exchanges, transactions, one-way messages, worker threads, polling and event-driven I/O, parallelism techniques (fork/join, computation trees and barriers), Communicating Sequential Processes (CSP). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder. |
![]() ![]() |
This page is posted |
http://mindprod.com/jgloss/queue.html |
Optional Replicator mirror
|
J:\mindprod\jgloss\queue.html | |
![]() |
Please read the feedback from other visitors,
or send your own feedback about the site. Contact Roedy. Please feel free to link to this page without explicit permission. | |
Canadian
Mind
Products
IP:[65.110.21.43] Your face IP:[3.145.92.183] |
| |
Feedback |
You are visitor number Statcounter | |