in reply to Re^15: Passing globs between threads (Updated).
in thread Passing globs between threads

The fine thing about RFC677 is that it works even when some participate at a later date. For instance:
Request ownership:
If the other thread doesn't want to work with this shared value or wants to overwrite it with an unrelated one, it doesn't make a difference if it locks the value or not. So this thread doesn't have to participate. If another thread wants to lock, the lock reply can be earlier or later than the modification message. If it's later the lock has obviously failed. So a modification message instead of a lock grant doubles as lock fail message (And the round trip time is shortened). If it's earlier it must have been even earlier at the other thread. So a lock request instead of a lock grant means the lock failed at the initiating thread, and should be granted.
Relinquishing lock:
Because a lock is over a range of sequence numbers, and every value has a sequence number of last modification, every value that has a sequence number greater or equal as the end of the lock range is effectively unlocked because it can be modified by greater sequence numbers. So modifying the value relinquishes the lock automagically. No time necessary.
  • Comment on Re^16: Passing globs between threads (Updated).