The mistake people make with shared state concurrency is pretending their code is mostly sequential, add locks to serialize blocks of code
Removing all direct use of atomics, except where needed to achieve AS-safety, is on my roadmap for @musllibc.
-
-
Of course you're right that locks must protect data not code. & they should be short-lived.
-
I have usually had ok results with threads being mostly independent, w/ locks over structures which need to be shared (ex: message queues).
-
Yes, main key to both performance and avoiding bugs is minimizing shared mutable state.
-
yep. though, OTOH, a model w/ workers+task lists and message queues is potentially a non-canonical way to do multithreading.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.