4 ms·
Nginx recently implemented thread pools for blocking operations. The distinction between threads and processes depends on the OS. The "nothing shared" model us
by slackingoff2017 9y ago
Nginx recently implemented thread pools for blocking operations. The distinction between threads and processes depends on the OS.
The "nothing shared" model used in Linux forking actually shares the underlying memory until the processes diverge (copy on write). The difference between this and threads is that threads expose the shared memory by default.
IMO the difference between threads and processes is somewhat academic.
I don't know much about BEAM
- robotresearcher 9y ago> IMO the difference between threads and processes is somewhat academic. Shared memory vs. isolated memory is a huge difference. You use completely different sync/protection/IPC approaches with each, so programs look very different. And the copy-on-write optimization of logically isolated memory doesn't effect that. The beauty of it is that it speeds up forking and saves memory without changing your IPC-based programming model.
- lmm 9y ago> IMO the difference between threads and processes is somewhat academic. At a linux-implementation level the difference is almost irrelevant. At a code level the difference between your variables being shared by default versus "thread"-local by default is huge.