4 ms·
> A language like Java would have the reliability angle covered but is hard to make performant. ConcurrentModificationException.
by catnaroek 10y ago
> A language like Java would have the reliability angle covered but is hard to make performant.
ConcurrentModificationException.
- the8472 10y agoThat is a runtime check similar to RefCell::borrow() panic if you try to read from it while something else is mutating it.
- catnaroek 10y agoWith two important differences: (0) RefCell can't be used in a multithreaded context. You have to use an actual Mutex. (1) ConcurrentModificationException isn't reliable. It's thrown on a best-effort basis. In any case, in a high-level language, just memory-safety is a very cheap guarantee. You also want to protect the internal invariants of your data structures - especially the concurrent ones!