4 ms·
Well, yes, but there is a reason why pthreads became a thing.
by gpderetta 5y ago
Well, yes, but there is a reason why pthreads became a thing.
- pjmlp 5y agoUntil people discovered the security and program stability issues that come with using them. It was a cool idea that turned out not so be so great after all. There is a reason why all major language runtimes are moving into thread agnostic runtimes, while security critical software and plugins are back into processes with OS IPC model.
- gpderetta 5y agoSorry, which languages? Go has shared memory multiprocessing, so does Rust, C#, Java...
- pjmlp 5y agoThey do, and in all of them is an anti-pattern to use raw threads instead of the higher level frameworks like goroutines, java.util.concurrent or TPL/DataFlow. Go in their typical wisdom, doesn't even support thread local storage. Additionally, Java and .NET have thrown away their security managers, and guess what is the best practice to regain their features in Java and .NET applications? Multi-processing with OS IPC.
- gpderetta 5y agoSorry, we are discussing shared memory multiprocessing. I'm certainly not advocating unrestricted use of pthread_create, but even more structured way of parallelization still rely on shared memory. But of course, for security address space separation is pretty much a requirement.
- Jweb_Guru 5y agoIt's not an antipattern to use threads in Rust. Where did you get that idea?