The SR algorithm will just cost the spinning time. In this case the SR algorithm will also suspend and resume, but it will spin for less time than the GT-SR algorithm Of course, in practice locks may not exhibit worst case behavior, so best algorithm depends on locking and unlocking patterns actually observed. Here is the SR algorithm. Again, can be improved with use of queueing locks. But a load instruction caches the data.
Subsequent loads come out of cache and never hit the bus.
Load memory location into register and mark it as loaded by this processor. A memory location can be marked as loaded by more than one processor. Otherwise, don't perform the store. Return whether or not the store succeeded. Unlock operation is the same as before.