G06F2209/523

Optimization of data locks for improved write lock performance and CPU cache usage in multi core architectures

Data access optimization features the innovative use of a writer-present flag when acquiring read-locks and write-locks. Setting a writer-present flag indicates that a writer desires to modify a particular data. This serves as an indicator to readers and writers waiting to acquire read-locks or write-locks not to acquire a lock, but rather to continue waiting (i.e., spinning) until the write-present flag is cleared. As opposed to conventional techniques in which readers and writers are not locked out until the writer acquires the write-lock, the writer-present flag locks out other readers and writers once a writer begins waiting for a write-lock (that is, sets a writer-present flag). This feature allows a write-lock method to acquire a write-lock without having to contend with waiting readers and writers trying to obtain read-locks and write-locks, such as when using conventional spinlock implementations.

Shared locking for storage centric exclusive locks

A computing device receives a request from a host for a shared lock on a resource. The computing device obtains an exclusive lock on the resource using a locking data structure that is stored on the storage domain. The computing device subsequently obtains a shared lock on the resource for the host by writing a flag to the locking data structure, wherein the flag indicates that the host has the shared lock on the resource. The computing device then releases the exclusive lock on the resource.

Accessing a shared data set

A computer implemented method of accessing a shared data set using a shared and an exclusive lock is provided. The method includes: initiating at least one reader thread configured to perform a read operation; recording a reader thread state for the at least one reader thread in a data structure; selectively acquiring the shared lock for the at least one reader thread; implementing processing of the at least one reader thread; selectively interrupting the processing of the at least one reader thread in response to an exclusive lock request; restoring the at least one reader thread state using the reader thread state recorded in the data structure and releasing the shared lock; acquiring an exclusive lock; resuming the processing of the at least one reader thread; reacquiring the shared lock for the at least one reader thread in response to determining a releasing of the exclusive lock.