Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's not accurate. You can mutate via shared reference too, as long as something ensures it's still thread safe (e.g. synchronized).

There's UnsafeCell type that is a deliberate loophole in immutability of types behind shared references. It's used as the basis for atomic access and mutexes.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: