On Dual and Quad Core CPU, is it random which core the application runs on?

GundamF91

Golden Member
May 14, 2001
1,827
0
0
Just wondering if there's a preference that when single-thread application runs on dual/quad cores, whether the application picks which core to run it on, or whether OS chooses which core to run. And is it chosen at random?
 

bsobel

Moderator Emeritus<br>Elite Member
Dec 9, 2001
13,346
0
0
Originally posted by: GundamF91
Just wondering if there's a preference that when single-thread application runs on dual/quad cores, whether the application picks which core to run it on, or whether OS chooses which core to run. And is it chosen at random?

On most OS's the application can control which processors it will run on by setting its affinity for them. But in general the OS scheduler handles scheduling of threads balancing them accross avaialble processors (moving them if needed).
 

Foxery

Golden Member
Jan 24, 2008
1,709
0
0
It's mostly a Windows issue, I believe. You can force affinity, but by default, the schedulers in XP and Vista move data between cores willy-nilly. I wouldn't expect to see *nix machines do this, but perhaps some Linux users can chime in.
 

bsobel

Moderator Emeritus<br>Elite Member
Dec 9, 2001
13,346
0
0
Originally posted by: Foxery
It's mostly a Windows issue, I believe. You can force affinity, but by default, the schedulers in XP and Vista move data between cores willy-nilly. I wouldn't expect to see *nix machines do this, but perhaps some Linux users can chime in.

How is thread scheduling a Windows issue?
 

VirtualLarry

No Lifer
Aug 25, 2001
56,587
10,225
126
On windows the starting cpu is random. According to docs that ive read, windows2000 isnt suposed to ping-pong threads like xp does.
 

bsobel

Moderator Emeritus<br>Elite Member
Dec 9, 2001
13,346
0
0
Originally posted by: VirtualLarry
On windows the starting cpu is random. According to docs that ive read, windows2000 isnt suposed to ping-pong threads like xp does.

Random suggests that no logic is applied, it's 'random' among available procs which is substantially different.
 

GundamF91

Golden Member
May 14, 2001
1,827
0
0
It appears to be random but it would appear that after looking at the Windows Task Mgr/Performance tab, my 1st Core is routinely used as a "first responder". When it's not full load, and 2 or 3 cores are used at some degree, the 1st Core still has higher usage.