3 ms·
Thread switch time does not scale to the # of threads involved. Switching between 100 threads each blocked on i/o is exactly as efficient time-wise as switching
by JoeAltmaier 14y ago
Thread switch time does not scale to the # of threads involved. Switching between 100 threads each blocked on i/o is exactly as efficient time-wise as switching between two threads ping-ponging the same i/o.
Memory footprint is somewhat applicable - often each has a (virtual) megabyte stack. So in 32-bit address mode you could run out of virtual memory!
- exDM69 14y ago> Thread switch time does not scale to the # of threads involved. True, but the number of context switches does increase and that in turn decreases the ratio of useful work vs. context switch overhead. Also the secondary costs of context switching, like flushing caches increase. If there are hundreds of threads, the chances that a thread is woken up with warm caches decreases.
- JoeAltmaier 14y agoAgain, my point Was that context switching is identical. That is equal to the # io completions and nothing else.