3 ms·
(2014) This article is a bit dated. It's all about locks that aren't directly connected to the data they lock. With the advent of Rust, people are finally gett
by Animats 7y ago
(2014)
This article is a bit dated. It's all about locks that aren't directly connected to the data they lock. With the advent of Rust, people are finally getting that "what locks what" is something the language should address. C/C++ locking is a legacy of the "that's an operating system problem" era of locking.
It's not just a safety issue. If you need to fence something, it helps if the compiler knows what to fence.
- gizmo686 7y agoTieing locks to data is not a new concept. Java provides an intrinsic lock on every object (along with special syntax around acquiring/releasing this lock)
- Animats 7y agoIt's not new at all. It goes back to Brinch Hansen and Hoare in the early 1970s.[1] Modula and Ada had it. But the C/C++ crowd tends not to know about it, because Unix and C did not originally have threads and concurrency was a retrofit. [1] https://en.wikipedia.org/wiki/Monitor_(synchronization) https://en.wikipedia.org/wiki/Monitor_(synchronization)