News for hackers. Stuff that matters.
Re:Grand Central Dispatch Now Open to All by wmf on Friday September 11, 2009 @02:08PM (#817784)
I've found very little documentation on this, but apparently the kernel optimizes multiple thread pools to prevent excessive context switches. (Consider an N-core system where multiple processes each create N worker threads of their own.)
Re:Grand Central Dispatch Now Open to All by scott_s on Friday September 11, 2009 @04:25PM (#818058)
Do you mean process migration (rescheduling a process/thread on a different core, which does bad things to caches) instead of context switching (switching between different processes/threads on the same core, which requires saving registers to memory and does bad things to caches)? If so, any decent modern scheduler tries to avoid migrating threads.
Re:Grand Central Dispatch Now Open to All by wmf on Friday September 11, 2009 @04:33PM (#818070)
When I said context switching I meant context switching. Now that you mention it, GCD may also reduce thread migrations. I'm just speculating since we don't know how GCD works.