摘要 |
A spin lock for shared memory is disclosed. A lock flag for a lock on a memory section is attempted to be set. If the lock flag is successfully set, the lock on the memory section is held so that the memory section may be processed. Upon being ready to release the lock on the memory section, and in response to determining that one or more units are spinning for the lock on the memory section, one of the spinning units is selected, and a spin flag for the selected unit is reset. If no units are spinning for the lock, however, the lock flag for the lock is reset.
|