Read lock and write lock management system based upon mutex and semaphore availability
First Claim
Patent Images
1. A method for simulating a read/write lock comprising:
- obtaining a read lock for a plurality of reader threads given a first condition occurs, the first condition comprising the availability of a mutex, said mutex comprising a single object that can be waited upon simultaneously by said plurality of reader threads and a plurality of writer threads; and
obtaining a write lock for a single writer thread given that a second condition occurs, the second condition comprising the simultaneous availability of a mutex and a semaphore, said semaphore comprising a single object that can be waited upon simultaneously by a plurality of writer threads.
1 Assignment
0 Petitions
Accused Products
Abstract
A method and apparatus for implementing a read/write lock mechanism in software. In an operating environment that allows objects such threads to wait on a plurality of synchronization objects simultaneously, a read/write lock can be implemented using two synchronization objects such as a mutex and a semaphore. Further, a variable is introduced to track the number of reader threads awaiting to read protected data. The read/write lock permits a plurality of reader threads to access protected data simultaneously, while only allowing a single writer thread access to a protected data location.
86 Citations
22 Claims
-
1. A method for simulating a read/write lock comprising:
-
obtaining a read lock for a plurality of reader threads given a first condition occurs, the first condition comprising the availability of a mutex, said mutex comprising a single object that can be waited upon simultaneously by said plurality of reader threads and a plurality of writer threads; and obtaining a write lock for a single writer thread given that a second condition occurs, the second condition comprising the simultaneous availability of a mutex and a semaphore, said semaphore comprising a single object that can be waited upon simultaneously by a plurality of writer threads. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A computer system comprising:
-
a processor; a memory coupled to said processor, said processor configured to; obtain a read lock for a plurality of reader threads given a first condition occurs, the first condition comprising the availability of a mutex, said mutex comprising a single object that can be waited upon simultaneously by said plurality of reader threads and a plurality of writer threads; and obtain a write lock for a single writer thread given that a second condition occurs, the second condition comprising the simultaneous availability of a mutex and a semaphore, said semaphore comprising a single object that can be waited upon simultaneously by a plurality of writer threads. - View Dependent Claims (18, 19, 20)
-
-
10. A computer readable medium comprising instructions, which when executed by a processor, perform the steps for simulating read/write lock comprising:
-
obtaining a read lock for a plurality of reader threads given a first condition occurs, the first condition comprising the availability of a mutex, said mutex comprising a single object that can be waited upon simultaneously by said plurality of reader threads and a plurality of writer threads; and obtaining a write lock for a single writer thread given that a second condition occurs, the second condition comprising the simultaneous availability of a mutex and a semaphore, said semaphore comprising a single object that can be waited upon simultaneously by a plurality of writer threads. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17)
-
-
21. A computer system comprising:
-
a processor configured to execute a plurality of threads; a memory coupled to the processor; a mutex comprising a single object that can be waited upon concurrently by a plurality of reader thread and a plurality of writer threads; a semaphore comprising a single object that can be waited upon concurrently by a plurality of writer threads; a read lock for a plurality of reader threads, said read lock obtained by a thread if a given first condition comprising the availability of a mutex occurs; and a write lock for a single writer thread if a second condition comprising the concurrent availability of the mutex and the semaphore occurs. - View Dependent Claims (22)
-
Specification