Threads and Cores

Everything else that doesn't fall into one of the other PB categories.
User avatar
RichAlgeni
Addict
Addict
Posts: 935
Joined: Wed Sep 22, 2010 1:50 am
Location: Bradenton, FL

Threads and Cores

Post 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
User avatar
idle
Always Here
Always Here
Posts: 6238
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Threads and Cores

Post 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.
Windows 11, Manjaro, Raspberry Pi OS
Image
Post Reply