Oddbean new post about | logout
 nostr:npub1jx3dzll682rmfgzla5wwyjjsk5f05eml4845nrxvww3ulnt3shxqq0m6x6 Rust offers both, channels and locking with a Mutex or RwLock. There also more flexible channels in crossbeam:
https://github.com/crossbeam-rs/crossbeam

It doesn't force you to use the easier and less error prone channels, but it also makes sharing memory much easier. It is proven that data races are not possible in Rust. On the other hand, Go knows about the problem and tell you to run a program with an optin tool as long until a data race is detected (if it was reached):
https://go.dev/doc/articles/race_detector