Advertisement
Advertisement
β‘ Community Insights
Discussion Sentiment
50% Positive
Analyzed from 233 words in the discussion.
Trending Topics
#value#messages#read#write#current#message#race#actors#timestamp#condition
Discussion Sentiment
Analyzed from 233 words in the discussion.
Trending Topics
Discussion (5 Comments)Read Original on HackerNews
The exact same thing but with more boilerplate.
* Have an "increment" message that adds n to the current value and returns the old value.
* Have separate "read" and "write" messages, where the "write" message is parameterized by a timestamp returned by the "read" message. If the owner detects that the timestamp sent by the write is older than the most recent timestamp, it's rejected.
Because messages are handled serially, it's easy and safe to create messages that behave sanely event without explicit locks.
One sender would get an out of date value, but it was current when sent.