Hacker News new | ask | show | jobs
by _yosefk 3803 days ago
That's true, and it's true of most languages, and unfortunately people trip over it even when they can totally avoid it by hiding threads behind other abstractions. So yeah, silly of me to have forgotten it.

That said, AFAIK language-level invariants in Java (and Python, etc.) cannot be violated by the lack of thread safety; meaning, you can still inspect every live object and see its state. Program-level invariants might go to heck, for sure. So what I should have said is more along the lines of "memory safety" than "lack of undefined behavior"; I'm not sure what the shortest and most precise way to put it is, though. (It does not quite end with memory safety but it doesn't quite get to lack of undefined behavior, either.)