Patent ID: 8145817

Claim:
A computer-implemented method for acquiring a read lock in a multiple processor system, the method comprising: receiving a request to acquire a read lock; inspecting a queue of waiting reader and writer nodes to identify a current queue tail, wherein a node at the head of the queue represents one or more threads that currently hold the lock and wherein new requests to acquire the lock are added at the current queue tail; upon determining that the current queue tail is a reader node, incrementing a reader count by performing the following: determining a distribution index associated with a current thread, wherein the distribution index distributes received read lock requests to multiple lock counts to reduce cache contention versus a single lock count; incrementing an indexed reader count based on the determined distribution index; and waiting for the reader node to become the head of the queue, and in response to the reader node becoming the head of the queue responding to the request indicating the lock is acquired, wherein the preceding steps are performed by at least one processor.