Overclock.net › Forums › General Hardware › General Processor Discussions › Question about multi-core CPU technology...
New Posts  All Forums:Forum Nav:

Question about multi-core CPU technology...

post #1 of 13
Thread Starter 
Alright so I have a question... I'll get right to it.

Now...

When you have a multi-core CPU how exactly does it handle your workload?

Lets say

My PC is completely idling.

Action #1 is I start encoding a video.

Then...

Action #2 is I start transfering large files.

After...

Action #3 is I start gaming.

ALL AT THE SAME TIME.

How does a multi-core CPU handle this workload?

Lets say for the sake of our example we have a Tri-Core CPU for our 3 actions given in this example...

Does...

Action #1 get assigned to Core #1?
Action #2 gets assigned to Core #2?
Action #3 gets assigned to Core #3?

Or...

Do all 3 Cores share the workload on all actions?

Which of these is it? Is there different modes you can use on your multi-core CPU?
     
CPUMotherboardGraphicsRAM
AMD Phenom II X4 965 Black Edition Deneb @ 3.4Ghz Asus M5A97 EVO Sapphire Radeon HD 6850 8GB Kingston HyperX DDR3 1600 
Hard DriveHard DriveCoolingOS
120GB Kingston HyperX 3K SSD (SATA III) 500GB Western Digital Caviar Black (SATA III) 2 x 120mm Thermaltake Fans  Windows Vista Home Premium 64-bit 
MonitorPowerCaseAudio
19" Optiquest Q91b  Thermaltake TR-600 TR2 (600W)  Thermaltake SopranoRS  Creative SB Audigy LS  
CPUMotherboardGraphicsRAM
Pentium IV HT 2.8C @ 3.5 GHz (SL6Z5) Asus P4P800 SE Sapphire Radeon X1950 GT 2GB Kingston HyperX DDR400 PC3200 
Hard DriveCoolingCoolingOS
200GB Seagate Barracuda 7200.8 (SATA) Thermaltake TR2-M12 (SOLID COPPER) 4 x 120mm Thermaltake Fans Windows XP Professional SP3 
MonitorPowerCaseAudio
19" Optiquest Q91b Thermaltake TR-600 TR2 (600W) Thermaltake SopranoRS Creative SB Audigy LS 
  hide details  
Reply
     
CPUMotherboardGraphicsRAM
AMD Phenom II X4 965 Black Edition Deneb @ 3.4Ghz Asus M5A97 EVO Sapphire Radeon HD 6850 8GB Kingston HyperX DDR3 1600 
Hard DriveHard DriveCoolingOS
120GB Kingston HyperX 3K SSD (SATA III) 500GB Western Digital Caviar Black (SATA III) 2 x 120mm Thermaltake Fans  Windows Vista Home Premium 64-bit 
MonitorPowerCaseAudio
19" Optiquest Q91b  Thermaltake TR-600 TR2 (600W)  Thermaltake SopranoRS  Creative SB Audigy LS  
CPUMotherboardGraphicsRAM
Pentium IV HT 2.8C @ 3.5 GHz (SL6Z5) Asus P4P800 SE Sapphire Radeon X1950 GT 2GB Kingston HyperX DDR400 PC3200 
Hard DriveCoolingCoolingOS
200GB Seagate Barracuda 7200.8 (SATA) Thermaltake TR2-M12 (SOLID COPPER) 4 x 120mm Thermaltake Fans Windows XP Professional SP3 
MonitorPowerCaseAudio
19" Optiquest Q91b Thermaltake TR-600 TR2 (600W) Thermaltake SopranoRS Creative SB Audigy LS 
  hide details  
Reply
post #2 of 13
The former (each on one core) unless the application isn't using enough horsepower, then it's shared between all cores.

If the application has seperate thrads then each is dedicated on one core with the remaining instructions bounced around where the performance is availiable.

Open task manager and open a game and you'll see the load switching between cores.

Encode something with a multi-threaded program and you'll see the load stay approx the same on all cores.
AMD Transplant
(11 items)
 
To be a NAS
(13 items)
 
Death Kühler
(14 items)
 
CPUMotherboardGraphicsRAM
965BE GA-78LMT-S2P MSI TFIII 7950 Corsair Vengence 
Hard DriveCoolingOSMonitor
Samsung 830 Noctua NH-D14 Win7 Pro FX2490HD 
PowerCaseMouse
Seasonic X660 Antec Three Hundred Saitek Rat 7 
CPUMotherboardGraphicsRAM
AMD Athlon 64 X2 4200+ Gateway GM5072 AMD HD5550 2.0 Gb 
Hard DriveMonitorKeyboardPower
Seagate Barracuda 500Gb Samsung FX2490 MS Keyboard 3000 300w generic 
Mouse
MS Intellipoint 3000 
CPUMotherboardGraphicsRAM
2500k GigaByte Z68M-D2H-B3 MSI 560 Ti TFIII Corsair Vengance 
Hard DriveCoolingOSMonitor
Samsung 830 Antec Khuler 920 Win7 HP Samsung FX2490 
KeyboardPowerCaseMouse
Microsoft Keyboard 3000 Seasonic X-660 Antec Three Hundred Microsoft Mouse 3000 
Mouse PadAudio
None - Blue Track baby Senn HD428 
  hide details  
Reply
AMD Transplant
(11 items)
 
To be a NAS
(13 items)
 
Death Kühler
(14 items)
 
CPUMotherboardGraphicsRAM
965BE GA-78LMT-S2P MSI TFIII 7950 Corsair Vengence 
Hard DriveCoolingOSMonitor
Samsung 830 Noctua NH-D14 Win7 Pro FX2490HD 
PowerCaseMouse
Seasonic X660 Antec Three Hundred Saitek Rat 7 
CPUMotherboardGraphicsRAM
AMD Athlon 64 X2 4200+ Gateway GM5072 AMD HD5550 2.0 Gb 
Hard DriveMonitorKeyboardPower
Seagate Barracuda 500Gb Samsung FX2490 MS Keyboard 3000 300w generic 
Mouse
MS Intellipoint 3000 
CPUMotherboardGraphicsRAM
2500k GigaByte Z68M-D2H-B3 MSI 560 Ti TFIII Corsair Vengance 
Hard DriveCoolingOSMonitor
Samsung 830 Antec Khuler 920 Win7 HP Samsung FX2490 
KeyboardPowerCaseMouse
Microsoft Keyboard 3000 Seasonic X-660 Antec Three Hundred Microsoft Mouse 3000 
Mouse PadAudio
None - Blue Track baby Senn HD428 
  hide details  
Reply
post #3 of 13
This all depends on the operating system kernel and it thread scheduling mechanisms. Threads can be likened to a core - at any one time on any core only one thread is running on the core (logical CPU). The kernel scheduler context switches very fast between threads (this means that it suspends a thread and allows another thread to execute for a certain amount of time, or until it terminates, or reaches a state in which it can no longer execute).

What "actions" get assigned to what cores are completely dependent on thread scheduling and architecture of the applications serving those "actions". Ideally, the operating system thread scheduler will try to keep a thread on the same core/logical CPU that it started on.

It could be a variable scenario - but assuming there were only 4 single-threaded actions in the system, ideally each would be assigned to a separate core by the kernel. This is not the case, there are hundreds of threads running in a system, and so the kernel scheduler decides based on what it knows about the system state which threads should run where.
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
post #4 of 13
Thread Starter 
So its a bit of both? eh-smiley.gif
     
CPUMotherboardGraphicsRAM
AMD Phenom II X4 965 Black Edition Deneb @ 3.4Ghz Asus M5A97 EVO Sapphire Radeon HD 6850 8GB Kingston HyperX DDR3 1600 
Hard DriveHard DriveCoolingOS
120GB Kingston HyperX 3K SSD (SATA III) 500GB Western Digital Caviar Black (SATA III) 2 x 120mm Thermaltake Fans  Windows Vista Home Premium 64-bit 
MonitorPowerCaseAudio
19" Optiquest Q91b  Thermaltake TR-600 TR2 (600W)  Thermaltake SopranoRS  Creative SB Audigy LS  
CPUMotherboardGraphicsRAM
Pentium IV HT 2.8C @ 3.5 GHz (SL6Z5) Asus P4P800 SE Sapphire Radeon X1950 GT 2GB Kingston HyperX DDR400 PC3200 
Hard DriveCoolingCoolingOS
200GB Seagate Barracuda 7200.8 (SATA) Thermaltake TR2-M12 (SOLID COPPER) 4 x 120mm Thermaltake Fans Windows XP Professional SP3 
MonitorPowerCaseAudio
19" Optiquest Q91b Thermaltake TR-600 TR2 (600W) Thermaltake SopranoRS Creative SB Audigy LS 
  hide details  
Reply
     
CPUMotherboardGraphicsRAM
AMD Phenom II X4 965 Black Edition Deneb @ 3.4Ghz Asus M5A97 EVO Sapphire Radeon HD 6850 8GB Kingston HyperX DDR3 1600 
Hard DriveHard DriveCoolingOS
120GB Kingston HyperX 3K SSD (SATA III) 500GB Western Digital Caviar Black (SATA III) 2 x 120mm Thermaltake Fans  Windows Vista Home Premium 64-bit 
MonitorPowerCaseAudio
19" Optiquest Q91b  Thermaltake TR-600 TR2 (600W)  Thermaltake SopranoRS  Creative SB Audigy LS  
CPUMotherboardGraphicsRAM
Pentium IV HT 2.8C @ 3.5 GHz (SL6Z5) Asus P4P800 SE Sapphire Radeon X1950 GT 2GB Kingston HyperX DDR400 PC3200 
Hard DriveCoolingCoolingOS
200GB Seagate Barracuda 7200.8 (SATA) Thermaltake TR2-M12 (SOLID COPPER) 4 x 120mm Thermaltake Fans Windows XP Professional SP3 
MonitorPowerCaseAudio
19" Optiquest Q91b Thermaltake TR-600 TR2 (600W) Thermaltake SopranoRS Creative SB Audigy LS 
  hide details  
Reply
post #5 of 13
aye. Mines the laymans response and his was the detailed response smile.gif.

Same answer really, cept I'm missing more than a few details thumb.gif
AMD Transplant
(11 items)
 
To be a NAS
(13 items)
 
Death Kühler
(14 items)
 
CPUMotherboardGraphicsRAM
965BE GA-78LMT-S2P MSI TFIII 7950 Corsair Vengence 
Hard DriveCoolingOSMonitor
Samsung 830 Noctua NH-D14 Win7 Pro FX2490HD 
PowerCaseMouse
Seasonic X660 Antec Three Hundred Saitek Rat 7 
CPUMotherboardGraphicsRAM
AMD Athlon 64 X2 4200+ Gateway GM5072 AMD HD5550 2.0 Gb 
Hard DriveMonitorKeyboardPower
Seagate Barracuda 500Gb Samsung FX2490 MS Keyboard 3000 300w generic 
Mouse
MS Intellipoint 3000 
CPUMotherboardGraphicsRAM
2500k GigaByte Z68M-D2H-B3 MSI 560 Ti TFIII Corsair Vengance 
Hard DriveCoolingOSMonitor
Samsung 830 Antec Khuler 920 Win7 HP Samsung FX2490 
KeyboardPowerCaseMouse
Microsoft Keyboard 3000 Seasonic X-660 Antec Three Hundred Microsoft Mouse 3000 
Mouse PadAudio
None - Blue Track baby Senn HD428 
  hide details  
Reply
AMD Transplant
(11 items)
 
To be a NAS
(13 items)
 
Death Kühler
(14 items)
 
CPUMotherboardGraphicsRAM
965BE GA-78LMT-S2P MSI TFIII 7950 Corsair Vengence 
Hard DriveCoolingOSMonitor
Samsung 830 Noctua NH-D14 Win7 Pro FX2490HD 
PowerCaseMouse
Seasonic X660 Antec Three Hundred Saitek Rat 7 
CPUMotherboardGraphicsRAM
AMD Athlon 64 X2 4200+ Gateway GM5072 AMD HD5550 2.0 Gb 
Hard DriveMonitorKeyboardPower
Seagate Barracuda 500Gb Samsung FX2490 MS Keyboard 3000 300w generic 
Mouse
MS Intellipoint 3000 
CPUMotherboardGraphicsRAM
2500k GigaByte Z68M-D2H-B3 MSI 560 Ti TFIII Corsair Vengance 
Hard DriveCoolingOSMonitor
Samsung 830 Antec Khuler 920 Win7 HP Samsung FX2490 
KeyboardPowerCaseMouse
Microsoft Keyboard 3000 Seasonic X-660 Antec Three Hundred Microsoft Mouse 3000 
Mouse PadAudio
None - Blue Track baby Senn HD428 
  hide details  
Reply
post #6 of 13
Thread Starter 
I still dont understand really...

On my single-core CPU... Just the other day... I was burning a data disk... Listening to music... viewing webpages on the internet... and editing textures in Paint Shop Pro with ease all at the same time...

So whats the benefit of a multi-core CPU?
     
CPUMotherboardGraphicsRAM
AMD Phenom II X4 965 Black Edition Deneb @ 3.4Ghz Asus M5A97 EVO Sapphire Radeon HD 6850 8GB Kingston HyperX DDR3 1600 
Hard DriveHard DriveCoolingOS
120GB Kingston HyperX 3K SSD (SATA III) 500GB Western Digital Caviar Black (SATA III) 2 x 120mm Thermaltake Fans  Windows Vista Home Premium 64-bit 
MonitorPowerCaseAudio
19" Optiquest Q91b  Thermaltake TR-600 TR2 (600W)  Thermaltake SopranoRS  Creative SB Audigy LS  
CPUMotherboardGraphicsRAM
Pentium IV HT 2.8C @ 3.5 GHz (SL6Z5) Asus P4P800 SE Sapphire Radeon X1950 GT 2GB Kingston HyperX DDR400 PC3200 
Hard DriveCoolingCoolingOS
200GB Seagate Barracuda 7200.8 (SATA) Thermaltake TR2-M12 (SOLID COPPER) 4 x 120mm Thermaltake Fans Windows XP Professional SP3 
MonitorPowerCaseAudio
19" Optiquest Q91b Thermaltake TR-600 TR2 (600W) Thermaltake SopranoRS Creative SB Audigy LS 
  hide details  
Reply
     
CPUMotherboardGraphicsRAM
AMD Phenom II X4 965 Black Edition Deneb @ 3.4Ghz Asus M5A97 EVO Sapphire Radeon HD 6850 8GB Kingston HyperX DDR3 1600 
Hard DriveHard DriveCoolingOS
120GB Kingston HyperX 3K SSD (SATA III) 500GB Western Digital Caviar Black (SATA III) 2 x 120mm Thermaltake Fans  Windows Vista Home Premium 64-bit 
MonitorPowerCaseAudio
19" Optiquest Q91b  Thermaltake TR-600 TR2 (600W)  Thermaltake SopranoRS  Creative SB Audigy LS  
CPUMotherboardGraphicsRAM
Pentium IV HT 2.8C @ 3.5 GHz (SL6Z5) Asus P4P800 SE Sapphire Radeon X1950 GT 2GB Kingston HyperX DDR400 PC3200 
Hard DriveCoolingCoolingOS
200GB Seagate Barracuda 7200.8 (SATA) Thermaltake TR2-M12 (SOLID COPPER) 4 x 120mm Thermaltake Fans Windows XP Professional SP3 
MonitorPowerCaseAudio
19" Optiquest Q91b Thermaltake TR-600 TR2 (600W) Thermaltake SopranoRS Creative SB Audigy LS 
  hide details  
Reply
post #7 of 13
Quote:
Originally Posted by iLeeT View Post

I still dont understand really...
On my single-core CPU... Just the other day... I was burning a data disk... Listening to music... viewing webpages on the internet... and editing textures in Paint Shop Pro with ease all at the same time...
So whats the benefit of a multi-core CPU?

None of those tasks require very much CPU resources.... Try encoding a video while playing a game. Actually, just try playing a modern AAA game on your CPU....



The true benefit of multi-core is power consumption is near linear for increase performance. A 100w CPU that gets a quadrupling of CPU performance through 3 more cores would consume about 400w.

To get more single-core performance, it would take an effort of additional logic (complex/expensive/consumes more power) and/or increase clock speeds (hard to scale/consumes a LOT more power). A quadrupling of 100w CPU performance without process shrinks would be something like 4000-8000w.


Po = Ps * (Fo/Fs) * (Uo^2/Us^2)
Ps is the power usage of the non-overclocked CPU
Po is the power usage of the overclocked CPU
Fs is the clock speed of the non-overclocked CPU
Fo is the clock speed of the overclocked CPU
Us is the default voltage of the non-overclocked CPU
Uo is the voltage at which the overclocked CPU runs
http://www.heatsink-guide.com/calcpower.htm
Edited by DuckieHo - 9/13/12 at 11:39am
Once again...
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 920 [4.28GHz, HT] Asus P6T + Broadcom NetXtreme II VisionTek HD5850 [900/1200] + Galaxy GT240 2x4GB G.Skill Ripjaw X [1632 MHz] 
Hard DriveOSMonitorKeyboard
Intel X25-M 160GB + 3xRAID0 500GB 7200.12 Window 7 Pro 64 Acer H243H + Samsung 226BW XARMOR-U9BL  
PowerCaseMouseMouse Pad
Antec Truepower New 750W Li Lian PC-V2100 [10x120mm fans] Logitech G9 X-Trac Pro 
  hide details  
Reply
Once again...
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 920 [4.28GHz, HT] Asus P6T + Broadcom NetXtreme II VisionTek HD5850 [900/1200] + Galaxy GT240 2x4GB G.Skill Ripjaw X [1632 MHz] 
Hard DriveOSMonitorKeyboard
Intel X25-M 160GB + 3xRAID0 500GB 7200.12 Window 7 Pro 64 Acer H243H + Samsung 226BW XARMOR-U9BL  
PowerCaseMouseMouse Pad
Antec Truepower New 750W Li Lian PC-V2100 [10x120mm fans] Logitech G9 X-Trac Pro 
  hide details  
Reply
post #8 of 13
Or folding.

Folding would be very effective. thumb.gif
AMD Transplant
(11 items)
 
To be a NAS
(13 items)
 
Death Kühler
(14 items)
 
CPUMotherboardGraphicsRAM
965BE GA-78LMT-S2P MSI TFIII 7950 Corsair Vengence 
Hard DriveCoolingOSMonitor
Samsung 830 Noctua NH-D14 Win7 Pro FX2490HD 
PowerCaseMouse
Seasonic X660 Antec Three Hundred Saitek Rat 7 
CPUMotherboardGraphicsRAM
AMD Athlon 64 X2 4200+ Gateway GM5072 AMD HD5550 2.0 Gb 
Hard DriveMonitorKeyboardPower
Seagate Barracuda 500Gb Samsung FX2490 MS Keyboard 3000 300w generic 
Mouse
MS Intellipoint 3000 
CPUMotherboardGraphicsRAM
2500k GigaByte Z68M-D2H-B3 MSI 560 Ti TFIII Corsair Vengance 
Hard DriveCoolingOSMonitor
Samsung 830 Antec Khuler 920 Win7 HP Samsung FX2490 
KeyboardPowerCaseMouse
Microsoft Keyboard 3000 Seasonic X-660 Antec Three Hundred Microsoft Mouse 3000 
Mouse PadAudio
None - Blue Track baby Senn HD428 
  hide details  
Reply
AMD Transplant
(11 items)
 
To be a NAS
(13 items)
 
Death Kühler
(14 items)
 
CPUMotherboardGraphicsRAM
965BE GA-78LMT-S2P MSI TFIII 7950 Corsair Vengence 
Hard DriveCoolingOSMonitor
Samsung 830 Noctua NH-D14 Win7 Pro FX2490HD 
PowerCaseMouse
Seasonic X660 Antec Three Hundred Saitek Rat 7 
CPUMotherboardGraphicsRAM
AMD Athlon 64 X2 4200+ Gateway GM5072 AMD HD5550 2.0 Gb 
Hard DriveMonitorKeyboardPower
Seagate Barracuda 500Gb Samsung FX2490 MS Keyboard 3000 300w generic 
Mouse
MS Intellipoint 3000 
CPUMotherboardGraphicsRAM
2500k GigaByte Z68M-D2H-B3 MSI 560 Ti TFIII Corsair Vengance 
Hard DriveCoolingOSMonitor
Samsung 830 Antec Khuler 920 Win7 HP Samsung FX2490 
KeyboardPowerCaseMouse
Microsoft Keyboard 3000 Seasonic X-660 Antec Three Hundred Microsoft Mouse 3000 
Mouse PadAudio
None - Blue Track baby Senn HD428 
  hide details  
Reply
post #9 of 13
A program may spawn multiple threads. A thread is actually a "part" of a program... it's actually kind of a little program on its own... So a big program might spawn several little programs, or threads, to do some of the work. The benefit of this is that one thread can run at the same time as another thread, so if there are multiple things a program needs done, it can get them all done at the same time by spawning multiple threads.

If you have a single-core CPU, then all the threads have to run on that one core, and so the OS quickly switches between each thread, allowing it to do a little bit of work, then switches to the next thread to let it run for a moment. In this way, everything seems to happen all at the same time. Multiple programs are really just multiple threads, since each program consists of at least one thread. These fast switches between which threads are running are what tompsonn referred to as context switches. Context switching was once the only way personal computers were capable of making it seem like multiple programs were running at the same time.

We pretty much hit a barrier of 4GHz with the Pentium 4 processors. It came to the point where the only way to make computers faster was to do more stuff in parallel rather than trying to do everything faster. It was possible, of course, to install two or four processors on one motherboard, but that is also problematic, because communicating between two processors requires fast interconnects. It was much cheaper and more cost effective to build processors that had multiple execution "cores" on one die. These execution cores can share the on-chip memory (called L1, L2, and L3 cache) with each other and communicate extremely fast with each other without having to send all that information over the motherboard.

Now, one thread can each run on one core. Each core also performs that same context switching that the old single-core processors used. This basically allows you to run 4 times the number of programs as you once could at the same time without having to increase the speed of the CPU.

The operating system will attempt to make sure each core is as idle as possible. So, if two threads are using a lot of CPU time, the OS might decide to move one of those threads to a core that isn't doing anything. Basically, the OS will try to make sure that each core is doing the same amount of work. This isn't always possible, of course, but most OSs do a good job of it. In your example, it would be likely that each program would be assigned to its own core, but only if each program is single-threaded. It is actually more likely that your video encoder program has several threads, so the OS would spread those threads out evenly over the 3 cores of your CPU. When the file transfers start, each file that is being transferred might be a single thread, so those would also get spread out. The game is probably only 1 thread, though, so it would get assigned to a single core. If that game is really intense and uses a lot of CPU time, then the OS might decide to move the file transfer and video encoder threads to the other cores in order to make sure the game doesn't stutter. Chances are that at least one encoder thread or one file transfer thread will still be left on that core, though, so you would probably see fewer FPS until the file transfers or the video encoder is done.

There is a huge amount of work put into the algorithms that tell Windows or Linux or Mac OS X (or any other OS) how to decide where to put the threads that make up the programs you run. It is extremely complicated. No matter how many threads your CPU has, the OS will be using both "modes", as you called them, to schedule your programs to run. As a matter of fact, when you boot up Windows, you are probably running at least 60 processes, many of which may be broken down into two or more threads. It isn't possible for you to really decide between context switching and core assignment. You can force a process to run on a single core, or to a selection of cores, but you can't turn off context switching.

One more important point that no one has pointed out, yet: If you are only running a single thread on your CPU, and your CPU has multiple cores, then it is not possible for that thread to run on all of the cores. One thread can only execute on one core at a time. It isn't possible to split a thread up and run it on multiple cores. A thread is basically the smallest unit of a program. That is why it is important for big programs to be written so that they are multi-threaded. That way you can take advantage of the extra power of the multi-core CPUs.

There is also one last bit of information to confuse everyone: HyperThreading. HT is a technology that allows a single core to execute two threads at the same time. It is similar to simply having two cores for each HT core, but it isn't quite that simple. What ends up happening is that sometimes an HT core can execute two threads at the same time, and sometimes it can't. It depends on what kind of calculations are being done by the threads, and whether the threads have been optimized for HT CPUs. HyperThreading is one thing that I don't understand about Intel's CPUs, and is something that I doubt I will ever understand. The best way to look at it, and the way most modern operating systems look at it, is that an HT core is two "virtual cores". That means that a single quad-core processor that supports HT is capable of running 8 threads simultaneously some of the time. Of course, that CPU is actually running hundreds of processes at the same time the way we see it, because we can't tell that each virtual core is switching through a dozen threads millions of times per second.

Sorry if I stepped on everyone's toes. I thought I could go a little more in-depth and maybe help out a little bit. Hope this helps.
Edited by N0BOX - 9/19/12 at 1:21am
post #10 of 13
Quote:
Originally Posted by N0BOX View Post

A program may spawn multiple threads. A thread is actually a "part" of a program... it's actually kind of a little program on its own... So a big program might spawn several little programs, or threads, to do some of the work. The benefit of this is that one thread can run at the same time as another thread, so if there are multiple things a program needs done, it can get them all done at the same time by spawning multiple threads.
If you have a single-core CPU, then all the threads have to run on that one core, and so the OS quickly switches between each thread, allowing it to do a little bit of work, then switches to the next thread to let it run for a moment. In this way, everything seems to happen all at the same time. Multiple programs are really just multiple threads, since each program consists of at least one thread. These fast switches between which threads are running are what tompsonn referred to as context switches. Context switching was once the only way personal computers were capable of making it seem like multiple programs were running at the same time.
We pretty much hit a barrier of 4GHz with the Pentium 4 processors. It came to the point where the only way to make computers faster was to do more stuff in parallel rather than trying to do everything faster. It was possible, of course, to install two or four processors on one motherboard, but that is also problematic, because communicating between two processors requires fast interconnects. It was much cheaper and more cost effective to build processors that had multiple execution "cores" on one die. These execution cores can share the on-chip memory (called L1, L2, and L3 cache) with each other and communicate extremely fast with each other without having to send all that information over the motherboard.
Now, one thread can each run on one core. Each core also performs that same context switching that the old single-core processors used. This basically allows you to run 4 times the number of programs as you once could at the same time without having to increase the speed of the CPU.
The operating system will attempt to make sure each core is as idle as possible. So, if two threads are using a lot of CPU time, the OS might decide to move one of those threads to a core that isn't doing anything. Basically, the OS will try to make sure that each core is doing the same amount of work. This isn't always possible, of course, but most OSs do a good job of it. In your example, it would be likely that each program would be assigned to its own core, but only if each program is single-threaded. It is actually more likely that your video encoder program has several threads, so the OS would spread those threads out evenly over the 3 cores of your CPU. When the file transfers start, each file that is being transferred might be a single thread, so those would also get spread out. The game is probably only 1 thread, though, so it would get assigned to a single core. If that game is really intense and uses a lot of CPU time, then the OS might decide to move the file transfer and video encoder threads to the other cores in order to make sure the game doesn't stutter. Chances are that at least one encoder thread or one file transfer thread will still be left on that core, though, so you would probably see fewer FPS until the file transfers or the video encoder is done.
There is a huge amount of work put into the algorithms that tell Windows or Linux or Mac OS X (or any other OS) how to decide where to put the threads that make up the programs you run. It is extremely complicated. No matter how many threads your CPU has, the OS will be using both "modes", as you called them, to schedule your programs to run. As a matter of fact, when you boot up Windows, you are probably running at least 60 processes, many of which may be broken down into two or more threads. It isn't possible for you to really decide between context switching and core assignment. You can force a process to run on a single core, or to a selection of cores, but you can't turn off context switching.
One more important point that no one has pointed out, yet: If you are only running a single thread on your CPU, and your CPU has multiple cores, then it is not possible for that thread to run on all of the cores. One thread can only execute on one core at a time. It isn't possible to split a thread up and run it on multiple cores. A thread is basically the smallest unit of a program. That is why it is important for big programs to be written so that they are multi-threaded. That way you can take advantage of the extra power of the multi-core CPUs.
There is also one last bit of information to confuse everyone: HyperThreading. HT is a technology that allows a single core to execute two threads at the same time. It is similar to simply having two cores for each HT core, but it isn't quite that simple. What ends up happening is that sometimes an HT core can execute two threads at the same time, and sometimes it can't. It depends on what kind of calculations are being done by the threads, and whether the threads have been optimized for HT CPUs. HyperThreading is one thing that I don't understand about Intel's CPUs, and is something that I doubt I will ever understand. The best way to look at it, and the way most modern operating systems look at it, is that an HT core is two "virtual cores". That means that a single quad-core processor that supports HT is capable of running 8 threads simultaneously some of the time. Of course, that CPU is actually running hundreds of processes at the same time the way we see it, because we can't tell that each virtual core is switching through a dozen threads millions of times per second.
Sorry if I stepped on everyone's toes. I thought I could go a little more in-depth and maybe help out a little bit. Hope this helps.

Great - I like that smile.gif
Although a fiber is technically a smaller unit of work tongue.gif
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: General Processor Discussions
Overclock.net › Forums › General Hardware › General Processor Discussions › Question about multi-core CPU technology...