READ/WRITE LOCK WITH REDUCED READER LOCK SAMPLING OVERHEAD IN ABSENCE OF WRITER LOCK ACQUISITION
First Claim
1. A method for synchronizing access to shared data, comprising:
- when reading said shared data;
testing a writer flag that indicates whether a data writer is attempting to access said shared data;
accessing said shared data using a relatively fast read mechanism if said writer flag is not set; and
accessing said shared data using a relatively slow read mechanism if said writer flag is set; and
when writing said shared data;
setting said writer flag and acquiring a lock on said shared data;
waiting for expiration of a grace period;
waiting until there are no data readers accessing said shared data using said relatively fast read mechanism; and
accessing said shared data.
1 Assignment
0 Petitions
Accused Products
Abstract
An improved reader-writer locking for synchronizing access to shared data. When writing the shared data, a writer flag is set and a lock is acquired on the shared data. The shared data may be accessed following the expiration of a grace period and a determination that there are no data readers accessing the shared data. When reading the shared data, the writer flag is tested that indicates whether a data writer is attempting to access the shared data. If the writer flag is not set, the shared data is accessed using a relatively fast read mechanism. If the writer flag is set, the shared data is accessed using a relatively slow read mechanism.
61 Citations
20 Claims
-
1. A method for synchronizing access to shared data, comprising:
-
when reading said shared data; testing a writer flag that indicates whether a data writer is attempting to access said shared data; accessing said shared data using a relatively fast read mechanism if said writer flag is not set; and accessing said shared data using a relatively slow read mechanism if said writer flag is set; and when writing said shared data; setting said writer flag and acquiring a lock on said shared data; waiting for expiration of a grace period; waiting until there are no data readers accessing said shared data using said relatively fast read mechanism; and accessing said shared data. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A data processing system having one or more processors, a memory and a communication pathway between the one or more processors and the memory, said system being adapted to synchronize access to shared data, and comprising:
-
a writer flag that indicates whether a data writer is attempting to access said shared data; fast path read logic adapted to coordinate relatively fast reader access to said shared data on behalf of a data reader when said writer flag is not set; slow path read logic adapted to coordinate relatively slow reader access to said shared data on behalf of said data reader when said writer flag is set; first write logic adapted to set said writer flag and acquire a lock on said shared data on behalf of said data writer; grace period processing logic adapted to implement a grace period following said writer flag being set; and second write logic adapted to wait until there are no data readers accessing said shared data using said fast read logic, and thereafter allow said data writer to access said shared data. - View Dependent Claims (9, 10, 11, 12, 13)
-
-
14. A computer program product for synchronizing access to shared data, comprising:
-
one or more machine-readable media; means provided by said one or more media for programming a data processing platform to operate as by; when reading said shared data; testing a writer flag that indicates whether a data writer is attempting to access said shared data; accessing said shared data using a relatively fast read mechanism if said writer flag is not set; and accessing said shared data using a relatively slow read mechanism if said writer flag is set; and when writing said shared data; setting said writer flag and acquiring a lock on said shared data; waiting for expiration of a grace period; waiting until there are no data readers accessing said shared data using said relatively fast read mechanism; and accessing said shared data. - View Dependent Claims (15, 16, 17, 18, 19)
-
-
20. A computer program product for synchronizing access to shared data, comprising:
-
one or more machine-readable media; means provided by said one or more media for programming a data processing platform to operate as by; setting a writer flag and acquiring a lock on said shared data; waiting for expiration of a grace period; waiting until there are no data readers accessing said shared data; and accessing said shared data.
-
Specification