O'Reilly logo

IBM WebSphere eXtreme Scale 6 by Anthony Chaves

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

FIFO queues

BackingMaps can act as FIFO (first-in, first-out) queues thanks to the getNextKey(int timeout) method. This method retrieves the next key in the map determined by its insertion order. When this method is called, a lock on the object is obtained so that next call to getNextKey(int timeout) does not return the same object. In order to iterate over an entire BackingMap, the application must explicitly remove the object with that key when the thread or process is finished with it. Otherwise, the key remains at the front of the queue and the next call to getNextKey(int timeout) returns a key that we have already operated upon. Without removing the key, a call to getNextKey(int timeout) will return the same key whenever the lock on that ...

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