▲ | codedokode 4 days ago | |||||||||||||||||||||||||
> Time is a slippery notion in concurrency. Most language-level memory models (e.g. Java) or even hardware-level concurrency models focus on happens-before relations, which are induced by executing certain operations You are correct, but for simplicity we can assume that the CPU executes one operation at a time and still have a valid model for reasoning about data races. > But ultimately, all inter-thread communication boils down to programs (or libraries) using barriers for acquire/release semantics and/or using compare/swap and atomic read-modify-write. Interesting. I read about STM and it reminded me of "modification box" algorithm for modifying immutable trees, which also uses versions. So it is another clever but complicated trick. Also it seems that it requires locking? That's not very good given that locks often need syscalls. | ||||||||||||||||||||||||||
▲ | titzer 4 days ago | parent | next [-] | |||||||||||||||||||||||||
> Also it seems that it requires locking? That's not very good given that locks often need syscalls. AFAIU in most STMs all the fast paths are implemented using lock-free algorithms with just barriers. | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
▲ | mrkeen 4 days ago | parent | prev [-] | |||||||||||||||||||||||||
> Also it seems that it requires locking? STM requires locking in the same way that GC requires malloc. It gets it right so that the programmer doesn't mess it up. | ||||||||||||||||||||||||||
|