摘要 |
PROBLEM TO BE SOLVED: To provide a new composite locking method not to lower the processing speed of a high frequency path. SOLUTION: When no thread to lock an object exists 1, zero is stored in both of a field for lock and a competitive bit. After that, the object is locked (light weight lock) by a certain thread, an identifier of the thread is stored in the field for lock 2. If no lock is attempted by other threads before the lock is released by the thread with the thread identifier, SPECIAL is stored in the field for lock 5 and the processing is returned to 1. When the lock is attempted by other threads before the lock is released, competition in the light weight lock is generated, therefore, the competitive bit is established to record the competition 3. After that, the competitive bit is cleared when the lock is transferred to heavy weight lock 4 and the processing of 4 is transferred to 1, if possible.
|