3 ms·
A context switch from one thread to another is less expensive than from one process to another. And there are other advantages to running in a shared memory add
by exDM69 15y ago
A context switch from one thread to another is less expensive than from one process to another. And there are other advantages to running in a shared memory address space. It tends to make some things complicated, but if getting the most out of your CPUs is the goal, threads are the way to go.
- d0mine 15y agoOn some systems (Linux) there is no difference once threads/processes are initialized. Simple benchmark confirms it (see my comment about mmap).