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

> you pay the overhead for the thread safety every time you use the object wether you need to or not.

That’s not correct. See, eg, `Mutex::get_mut` (https://doc.rust-lang.org/stable/std/sync/struct.Mutex.html#...). It gives access to the underlying data without any locks or synchronization, if you can prove that no other threads ca access the mutex concurrently at the point of call.



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

Search: