Page 1 of 1

Threads and Cores

Posted: Fri Nov 30, 2012 4:05 am
by RichAlgeni
When a process spawns a thread, is that thread locked to the core that spawned the thread, or is the OS able to spread the load of the threads to different cores?

I used Process Explorer by Mark Russinovich, it shows the CPU usage by core, but it's hard to determine what exactly is happening when a new thread is spawned. This is really just for personal knowledge, but one of the reasons I asked is that CPU 5 (Core 2) seems to never show any activity, at least when I monitor it!

Rich

Image

Re: Threads and Cores

Posted: Fri Nov 30, 2012 4:37 am
by idle
I'm only guessing, you could have
1 run and finish
2 thread gets suspended and resumed on same core
3 process gets suspended resumes on next core

unless you lock a process to a core with set thread affinity then it will likely move between cores
as for the core with no activity perhaps the kernel has locked it.