Jump to content

Cores and threads

Go to solution Solved by Mira Yurizaki,
23 minutes ago, Fez760 said:

Simple question that apparently google cant answer (or i dont know where to look) is there a notable difference between 4c 4t and 4c 8t 

Yes and no. It depends on what the application is doing. Which all of this will be explained in the next bit :P

Quote

PS what on earth is a thread and why are they (from what ive noticed) double the cores

This is going to take a bit of explaining to scratch the surface of this.

 

Basically, a thread is a task in an application. If our application is a web browser, there would be threads for handling the network traffic, rendering the GUI, and executing the JavaScript code, among others. For the purposes of scheduling what work goes on a CPU, threads are the smallest unit that can be scheduled. Threads also have a life cycle and they reside in one of the following states:

  • Blocked/Sleeping: The thread is waiting on something, like an event or a computer resource that some other thread has.
  • Ready: Whatever the thread was waiting on happened and can be executed
  • Running: The thread is currently running on a CPU
  • Done: The thread is done executing and its resources can be freed up.

That takes care of the software side, now onto the hardware side.

 

CPUs used to be able to do only one thing at a time. Then some people thought of a way to do more work at the same time. One of these methods is called superscalar pipelining. Instead of having one execution unit, the CPU has two or more. And if a thread has operations that don't affect each other, like say x = a + b and y = c + d, then the CPU can execute those operations at the same time use those extra execution units.

 

Someone figured out that not every application's threads can utilize all the extra execution units, leaving wasted potential. So they made it that the CPU can take in another thread that can use the unused execution units. Intel calls this feature HyperThreading, though the generic name for this is simultaneous multithreading (or SMT).

 

The thing with SMT is its benefits depend on the average utilization of execution units on what we'll call the primary thread (this isn't a real term, I just lack a better one). So if the primary thread is taking up say 75% of the execution units on a core, that only leaves 25% left for a secondary thread to use. In practice, SMT improves performance by about 10%-20% on average for an application that is optimized for it.

 

So it's a way to squeeze more processing power out of a CPU, but it's not exactly a miracle feature.

 

EDIT: The reason why threads are double the core count is because for most use cases, there's almost zero benefit for adding more threads to the CPU. Though some processors have more than two threads per core, like Xeon Phi which can have four threads per CPU core. But from what I could gather, the reason why it does this it's more expensive to switch threads out than it is to leave them on the CPU.

Usually in the "old days" 1 core was executing 1 thread. Then Hyperthreading came around that brought that one core could handle two threads the same time. 

 

So 4c 8t is not the same performance as 8c 8t. but it is better in multicore than 4c 4t. 

 

The Core I5 for example are 1 thread per core. The I7 have usually 2 threads per core. 

Main System:

Anghammarad : Asrock Taichi x570, AMD Ryzen 7 5800X @4900 MHz. 32 GB DDR4 3600, some NVME SSDs, Gainward Phoenix RTX 3070TI

 

System 2 "Igluna" AsRock Fatal1ty Z77 Pro, Core I5 3570k @4300, 16 GB Ram DDR3 2133, some SSD, and a 2 TB HDD each, Gainward Phantom 760GTX.

System 3 "Inskah" AsRock Fatal1ty Z77 Pro, Core I5 3570k @4300, 16 GB Ram DDR3 2133, some SSD, and a 2 TB HDD each, Gainward Phantom 760GTX.

 

On the Road: Acer Aspire 5 Model A515-51G-54FD, Intel Core i5 7200U, 8 GB DDR4 Ram, 120 GB SSD, 1 TB SSD, Intel CPU GFX and Nvidia MX 150, Full HD IPS display

 

Media System "Vio": Aorus Elite AX V2, Ryzen 7 5700X, 64 GB Ram DDR4 3200 Mushkin, 1 275 GB Crucial MX SSD, 1 tb Crucial MX500 SSD. IBM 5015 Megaraid, 4 Seagate Ironwolf 4TB HDD in raid 5, 4 WD RED 4 tb in another Raid 5, Gainward Phoenix GTX 1060

 

(Abit Fatal1ty FP9 IN SLI, C2Duo E8400, 6 GB Ram DDR2 800, far too less diskspace, Gainward Phantom 560 GTX broken need fixing)

 

Nostalgia: Amiga 1200, Tower Build, CPU/FPU/MMU 68EC020, 68030, 68882 @50 Mhz, 10 MByte ram (2 MB Chip, 8 MB Fast), Fast SCSI II, 2 CDRoms, 2 1 GB SCSI II IBM Harddrives, 512 MB Quantum Lightning HDD, self soldered Sync changer to attach VGA displays, WLAN

Link to comment
https://linustechtips.com/topic/918087-cores-and-threads/#findComment-11257008
Share on other sites

Link to post
Share on other sites

Depends on what you are doing - productivity generally benefits from the extra cores. 

 

Threads basically allow a core to act as 2 cores. 

 

Ryzen Ram Guide

 

My Project Logs   Iced Blood    Temporal Snow    Temporal Snow Ryzen Refresh

 

CPU - Ryzen 1700 @ 4Ghz  Motherboard - Gigabyte AX370 Aorus Gaming 5   Ram - 16Gb GSkill Trident Z RGB 3200  GPU - Palit 1080GTX Gamerock Premium  Storage - Samsung XP941 256GB, Crucial MX300 525GB, Seagate Barracuda 1TB   PSU - Fractal Design Newton R3 1000W  Case - INWIN 303 White Display - Asus PG278Q Gsync 144hz 1440P

Link to comment
https://linustechtips.com/topic/918087-cores-and-threads/#findComment-11257013
Share on other sites

Link to post
Share on other sites

Depends on the type of load. Some benefit significantly from additional threads while others don't use them at all. It's not really a question that can be answered in a way other than "it depends". 

 

Threads are logical processors, while cores are physical processors. Each core will count as a thread (as a physical processor is also a logical one), but some CPUs have additional logical processors (Hyperthreading, in the case on Intel, or SMT as a more general term). 

 

https://en.wikipedia.org/wiki/Simultaneous_multithreading

 

https://en.wikipedia.org/wiki/Multithreading_(computer_architecture)

Link to comment
https://linustechtips.com/topic/918087-cores-and-threads/#findComment-11257017
Share on other sites

Link to post
Share on other sites

23 minutes ago, Fez760 said:

Simple question that apparently google cant answer (or i dont know where to look) is there a notable difference between 4c 4t and 4c 8t 

Yes and no. It depends on what the application is doing. Which all of this will be explained in the next bit :P

Quote

PS what on earth is a thread and why are they (from what ive noticed) double the cores

This is going to take a bit of explaining to scratch the surface of this.

 

Basically, a thread is a task in an application. If our application is a web browser, there would be threads for handling the network traffic, rendering the GUI, and executing the JavaScript code, among others. For the purposes of scheduling what work goes on a CPU, threads are the smallest unit that can be scheduled. Threads also have a life cycle and they reside in one of the following states:

  • Blocked/Sleeping: The thread is waiting on something, like an event or a computer resource that some other thread has.
  • Ready: Whatever the thread was waiting on happened and can be executed
  • Running: The thread is currently running on a CPU
  • Done: The thread is done executing and its resources can be freed up.

That takes care of the software side, now onto the hardware side.

 

CPUs used to be able to do only one thing at a time. Then some people thought of a way to do more work at the same time. One of these methods is called superscalar pipelining. Instead of having one execution unit, the CPU has two or more. And if a thread has operations that don't affect each other, like say x = a + b and y = c + d, then the CPU can execute those operations at the same time use those extra execution units.

 

Someone figured out that not every application's threads can utilize all the extra execution units, leaving wasted potential. So they made it that the CPU can take in another thread that can use the unused execution units. Intel calls this feature HyperThreading, though the generic name for this is simultaneous multithreading (or SMT).

 

The thing with SMT is its benefits depend on the average utilization of execution units on what we'll call the primary thread (this isn't a real term, I just lack a better one). So if the primary thread is taking up say 75% of the execution units on a core, that only leaves 25% left for a secondary thread to use. In practice, SMT improves performance by about 10%-20% on average for an application that is optimized for it.

 

So it's a way to squeeze more processing power out of a CPU, but it's not exactly a miracle feature.

 

EDIT: The reason why threads are double the core count is because for most use cases, there's almost zero benefit for adding more threads to the CPU. Though some processors have more than two threads per core, like Xeon Phi which can have four threads per CPU core. But from what I could gather, the reason why it does this it's more expensive to switch threads out than it is to leave them on the CPU.

Link to comment
https://linustechtips.com/topic/918087-cores-and-threads/#findComment-11257059
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×