3 ms·
All of the "my non-Haskell language does this" comments in the thread are the same (with maybe a Rust exception). The "lock" instruction is what the article is
by mrkeen 11mo ago
All of the "my non-Haskell language does this" comments in the thread are the same (with maybe a Rust exception).
The "lock" instruction is what the article is telling you to ditch.
> If the programmer forgets to lock the mutex the system won't stop them from accessing the data anyways
If the programmer forgets to "lock"
> and even then there's no actual link between the data being locked and the lock itself
lock (thing) {
return thing.contents // shared, mutable array given out freely to the world
}
'contents' has no notion that it has anything to do with this "lock"ing thing.
- Surac 11mo agoOK, seems my english was not enough to see the point. after reading this clear explantation is have to agree with you 100%