Patent ID: 7155727

Claim:
A computer-implemented method for buffering data in a multithreaded environment, comprising: reading a buffer index value that identifies a data buffer that was last used for buffering data; incrementing the buffer index value; locating a buffer array entry that is associated with the buffer index value; determining, at a particular time, whether the buffer array entry indicates a particular value; if the buffer array entry does not indicate the particular value at the particular time, then, in response to a determination at the particular time that the buffer array entry does not indicate the particular value, attempting to obtain a lock on a particular data buffer that is associated with the buffer array entry; and if the buffer array entry indicates the particular value at the particular time, then, in response to a determination at the particular time that the buffer array entry indicates the particular value, incrementing the buffer index value without attempting to obtain a lock on the particular data buffer.