3 ms·
My opinion is the opposite, to the point I would argue that anyone advocating for multithreading for reasons other than executing things in parallel on differen
by mgaunard 3y ago
My opinion is the opposite, to the point I would argue that anyone advocating for multithreading for reasons other than executing things in parallel on different cores is extremely dangerous and shouldn't be allowed anywhere near a serious codebase.
- psychphysic 3y agoErlang/OTP has entered the chat.
- pltzxy 3y agoAre you talking about Rust (which I don't know)? In Python the async people don't care much about correctness.
- mgaunard 3y agoIt's language-agnostic. The language with the most advanced concurrency memory model is C++.
- GolDDranks 3y agoRust pretty much alleviates these dangers. At least no memory safety bugs because of multithreading. Logic bugs are still possible, of course, but the channel API and the scoped thread API in the standard library do help with those.
- mgaunard 3y agoThat is not true at all, "fearless concurrency" gives no valuable guarantees at all and is widely seen as one of the worst concurrency models in literature.
- GolDDranks 3y agoI don't dispute that, but I thought you were having C++ with threads as the starting point, in which case Rust very much gives you valuable guarantees.
- dom96 3y agoI probably wouldn't go as far as saying "extremely dangerous" but I do agree. For the most popular use case (i.e. web services) a thread per core with an event loop in each thread is the best model.