bellwether
Joined 13 years ago
Karma
94
Submissions
51
Member since
Mar 29
Joined 13 years ago
Does anyone need collaboration on a DeFi, web3 smart contract, or other FinTech project? If so, please reach out to me (email is in profile).
Personally, if I saw members on my team looking for work, I would want to understand that decision: is it for personal reasons, is it because they felt unable to grow, is it because of salary, or is it because they find the work no longer meaningful?
There are plenty of reasons to move on from a role. Firing someone for wanting something that aligns better with their future is beyond petty imo.
In this article, the locks are mutually exclusive. Reads are not blocked by Writes, and vice-versa, but Writers would block against other Writers.
The downside is that Readers need to check which "version" of the data they read, to see if it was modified during the operation by a Writer--since Writers do not block for Readers like they do with RwLock.
It's elegant because, in most scenarios, Readers will not need to re-read because the version won't change mid-run between an optimistic read lock and its unlock. In the cases where that does happen, your code needs to handle retrying the read / loop logic, which is why the article argues for a compiler mechanism to enforce that check and avoid "foot gun" scenarios.