O'Reilly logo

Java Thread Programming by Paul Hyde

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required