Patent ID: 8122168
Filing Date: 2012-02-21
Classification: G06F

Abstract:
1. A method for implementing concurrent producer-consumer buffers, comprising: providing a putter lock; said putter lock performing putter operations associated with a concurrent producer-consumer buffer; providing a taker lock; said taker lock performing taker operations associated with the concurrent producer-consumer buffer; allowing said putter operations to acquire and lock the putter lock when putting into the concurrent producer-consumer buffer; and allowing said taker operations to acquire and lock the taker lock when taking from the concurrent producer-consumer buffer; said putter operations and taker operations being performed independently of one another, said taker and said putter lock being acquired and released independently of one another and independently of an associated wait-notify mechanism; wherein one putter operation waits for another putter operation to release the putter lock, and wherein tracking of used and empty slots is disassociated from the putter lock and the taker lock, and one variable is used for the tracking of used and empty slots, said one variable being implemented as an atomic object operable for atomic operation, and wherein the putter operations need not acquire the taker lock and the taker operations need not acquire the putter lock, and wherein the putter lock guards inserting operations by a plurality of threads and the taker lock guards extracting operations by the plurality of threads, wherein the putter lock and the taker lock are two main locks associated with the concurrent producer-consumer buffer as a whole.