Re:Rust solves the problem of incomplete Kernel Linux API docs
by jpc0 on Saturday August 31, 2024 @03:04PM
(#41411066)
> Not to mention mutexes are just slower in general than having types which are natively Send+Sync
Without knowing the implementation, how would you know this statement is true?
I could just stick the Arc<Mutex<T>> within my abstraction and say it is send+sync and it would have the exact same performance, and that might be the most efficient solution possible on the given hardware.
To a first approximation, Arc<Mutex<T>> is what you want when you want a blob of mutable stuff to just work between threads, but you still have to worry about terrible performance if you hold the mutexes too long, etc. (Not to mention mutexes are just slower in general than having types which are natively Send+Sync.)