3 ms·
Yes, mixing some concepts in programming is a terrible idea. Perhaps this is also widely unpopular, but it's the parallelism that needs to be treated with care
by darioush 2y ago
Yes, mixing some concepts in programming is a terrible idea.
Perhaps this is also widely unpopular, but it's the parallelism that needs to be treated with care and the additional caution, as often the parallelism itself is the terrible idea.
Concurrent code often has unpredictable performance due to cache behavior and NUMA, unpredictable lock contention, and the fact that often there is no measure of whether the bottleneck is CPU or I/O.
What most people want from concurrency (like computing the response to independent HTTP requests) can be done by separate processes, and the OS can abstract the issues away. As another reference, the entire go language is designed around avoiding shared memory (and using message passing -- even though it doesn't use processes for separation it encourages coding like you did).
But also sharing memory between processes can be handled with care via mappings and using the OS.
- Tainnor 2y ago> What most people want from concurrency (like computing the response to independent HTTP requests) can be done by separate processes OS processes are way too heavyweight for many use cases.