3 ms·
Java's collections don't (and can't, without high cost) make any guarantees that they will throw such an exception whenever they are modified concurrently... fo
by dbaupp 10y ago
Java's collections don't (and can't, without high cost) make any guarantees that they will throw such an exception whenever they are modified concurrently... for one, data races can have weird consequences that aren't easy to detect. On that point, data races in Java are not undefined behaviour, they just have very weak guarantees about what happens (basically isolated loads and stores do reasonable things, and no fancier operations are available) which is another alternative to the Rust approach and the GIL approach.
- catnaroek 10y ago> they just have very weak guarantees about what happens (...) which is another alternative Not a very usable one. It means that atomicity is something you have to fight very hard to actually get, and very easy to accidentally destroy.