Patent ID: 7558889

Claim:
A method in a computer system for accessing a collection of data items, the method comprising: defining a pointer to indicate a location for a bucket; defining a lower bound to indicate a number of items in the collection; and determining based on the lower bound whether the collection has a data item; and when it is determined that the collection has a data item, adjusting the lower bound to indicate that the collection has one less data item; reading from the bucket at the location defined by the pointer using a synchronization access mode of sync so that if the bucket is currently marked empty, the reading is delayed until the bucket is marked full and so that the bucket is marked empty upon reading to prevent subsequent reading from the bucket until the bucket is written to; removing a data item from association with the bucket at the location defined by the pointer; and writing to the bucket at the location defined by the pointer using a synchronization access mode of sync so that the bucket is marked full allowing reading from the bucket; when access to the location by a thread is blocked, enabling an exception to be raised when the location is next accessed; and blocking the thread; and when an exception is raised as a result of access by another thread to that location, completing the access by that other thread to that location; and restarting execution of the blocked thread.