Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Addition & Subtration core assignments
New Posts  All Forums:Forum Nav:

Addition & Subtration core assignments

post #1 of 2
Thread Starter 
I am learning C++ and I noticed this interesting phenomenon:

When executing a loop counting up, the second core is used:


When executing a loop counting down, the first core is used:


I just though you guys & gals might find this an interesting peek into the workings of a multi-core processor. I think it's neat!

 
Golden Copper
(14 items)
 
 
CPUMotherboardGraphicsGraphics
Intel Core i5 3210M (3.1 Ghz) Asus G46VW.210 Nvidia GTX 660M 2GB (GDDR5; 950/1250) Intel HD Graphics 4000M 
RAMHard DriveMonitorMouse
8GB (DDR3; 800; 1T) 750GB (5200rpm) 14" LCD Gigabyte M6900 
CPUMotherboardGraphicsRAM
AMD PII X4 940 BE (235x14.5; 3.4 Ghz; 1.475v) ASUS M4A78-E (NB: 2585Mhz) ATI HD 7870 (3.839 GB; 1000Mhz core; 1200Mhz mem) Kingston 4G Dual Channel DDRII 940 Mhz (2x2G) 
Hard DriveOptical DriveCoolingOS
Western Digital WD10EZEX (1.0 TB) ASUS DVDRW +/- & BR R Scythe Ninja Cu Windows 7 Ultimate (x64) 
MonitorKeyboardPowerCase
LG 27" W2753V Logitech White Backlit CM 750w (60a @ 1x12v) Antec 300 
Mouse
Gigabyte M6900 
  hide details  
Reply
 
Golden Copper
(14 items)
 
 
CPUMotherboardGraphicsGraphics
Intel Core i5 3210M (3.1 Ghz) Asus G46VW.210 Nvidia GTX 660M 2GB (GDDR5; 950/1250) Intel HD Graphics 4000M 
RAMHard DriveMonitorMouse
8GB (DDR3; 800; 1T) 750GB (5200rpm) 14" LCD Gigabyte M6900 
CPUMotherboardGraphicsRAM
AMD PII X4 940 BE (235x14.5; 3.4 Ghz; 1.475v) ASUS M4A78-E (NB: 2585Mhz) ATI HD 7870 (3.839 GB; 1000Mhz core; 1200Mhz mem) Kingston 4G Dual Channel DDRII 940 Mhz (2x2G) 
Hard DriveOptical DriveCoolingOS
Western Digital WD10EZEX (1.0 TB) ASUS DVDRW +/- & BR R Scythe Ninja Cu Windows 7 Ultimate (x64) 
MonitorKeyboardPowerCase
LG 27" W2753V Logitech White Backlit CM 750w (60a @ 1x12v) Antec 300 
Mouse
Gigabyte M6900 
  hide details  
Reply
post #2 of 2
Most likely a coincidence. The OS will choose the core based on what is most available at the time, there is no core preference for programs as far as I am aware.

Also, the OS chooses a core for your process, and it stays on that core. So if your program did addition and then subtraction, they would both execute on the same core.

Finally, the OS knows nothing about your program in advance, it has no idea your program will be doing addition or subtraction, so it wouldn't be able to pick a core one way or the other.
Edited by lordikon - 5/16/11 at 5:36pm
Foldatron
(17 items)
 
Mat
(10 items)
 
Work iMac
(9 items)
 
CPUMotherboardGraphicsGraphics
i7 950 EVGA x58 3-way SLI EVGA GTX 660ti GTX 275 
RAMHard DriveHard DriveHard Drive
3x2GB Corsair Dominator DDR3-1600 80GB Intel X25-M SSD 2TB WD Black 150GB WD Raptor 
Hard DriveOSMonitorKeyboard
2x 150GB WD V-raptor in RAID0 Win7 Home 64-bit OEM 55" LED 120hz 1080p Vizio MS Natural Ergonomic Keyboard 4000 
PowerCase
750W PC P&C Silencer CoolerMaster 690 
CPUGraphicsRAMHard Drive
Intel Core i5 2500S AMD 6770M 8GB (2x4GB) at 1333Mhz 1TB, 7200 rpm 
Optical DriveOSMonitorKeyboard
LG 8X Dual-Layer "SuperDrive" OS X Lion 27" iMac screen Mac wireless keyboard 
Mouse
Mac wireless mouse 
CPUGraphicsRAMHard Drive
i7-2600K AMD 6970M 1GB 16GB PC3-10600 DDR3 1TB 7200rpm 
Hard DriveOptical DriveOSMonitor
256GB SSD 8x DL "SuperDrive" OS X 10.7 Lion 27" 2560x1440 iMac display 
Monitor
27" Apple thunderbolt display 
  hide details  
Reply
Foldatron
(17 items)
 
Mat
(10 items)
 
Work iMac
(9 items)
 
CPUMotherboardGraphicsGraphics
i7 950 EVGA x58 3-way SLI EVGA GTX 660ti GTX 275 
RAMHard DriveHard DriveHard Drive
3x2GB Corsair Dominator DDR3-1600 80GB Intel X25-M SSD 2TB WD Black 150GB WD Raptor 
Hard DriveOSMonitorKeyboard
2x 150GB WD V-raptor in RAID0 Win7 Home 64-bit OEM 55" LED 120hz 1080p Vizio MS Natural Ergonomic Keyboard 4000 
PowerCase
750W PC P&C Silencer CoolerMaster 690 
CPUGraphicsRAMHard Drive
Intel Core i5 2500S AMD 6770M 8GB (2x4GB) at 1333Mhz 1TB, 7200 rpm 
Optical DriveOSMonitorKeyboard
LG 8X Dual-Layer "SuperDrive" OS X Lion 27" iMac screen Mac wireless keyboard 
Mouse
Mac wireless mouse 
CPUGraphicsRAMHard Drive
i7-2600K AMD 6970M 1GB 16GB PC3-10600 DDR3 1TB 7200rpm 
Hard DriveOptical DriveOSMonitor
256GB SSD 8x DL "SuperDrive" OS X 10.7 Lion 27" 2560x1440 iMac display 
Monitor
27" Apple thunderbolt display 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Addition & Subtration core assignments