Chapter 18. First-In-First-Out (FIFO) Queue

IN THIS CHAPTER

The First-In-First-Out (FIFO) queue is a data structure that has many applications in systems development. In this chapter, I'll show you a version of a FIFO queue that supports simultaneous access by multiple threads. In particular, I'll present two versions that are usable in the real world, as they are, and extendable:

  • ObjectFIFO, which holds references to objects

  • ByteFIFO, which holds byte values directly

How a FIFO Queue Works

As elements are added to a FIFO queue, they are stored in order. When elements ...

Get Java Thread Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.