An RwLock fallback implementatoin cannot be done with a mutex, as it prevents multiple read locks e.g. from the same thread to happen, or prevents co-dependent threads that all should have read locks from progressing together. In fact, even the simple example in the Rust std docs for RwLock will panic immediately.
An RwLock fallback implementatoin cannot be done with a mutex, as it prevents multiple read locks e.g. from the same thread to happen, or prevents co-dependent threads that all should have read locks from progressing together. In fact, even the simple example in the Rust std docs for RwLock will panic immediately.
Split off from https://github.com/rust9x/rust/issues/32#issuecomment-2226911009
Interesting links: