What is core and thread?

shengton

Distinguished
Oct 5, 2008
60
9
18,545
Hello, good evening. :)

Can someone explain to me what the difference is between the "core" and "thread" of a processor?

Thanks and God bless.
 
Last edited by a moderator:
A thread is a single line of commands that are getting processed. Each application has at least one thread, most have multiples. A core is the physical hardware that works on the thread. In general, a processor can only work on one thread per core (CPUs with hyper threading can work on up to two threads per core).

For processors with hyper threading, there are extra registers and execution units in the core so it can store the state of two threads and work on them both. To change threads, you normally have to empty the registers into the cache, write that back to the main memory, then load up the cache with the new values and load up the registers. Context switches hurt performance significantly.
 
Last edited by a moderator:
  • Like
Reactions: Name doesnt matter

diellur

Distinguished
Apr 7, 2011
1,345
0
19,460
Core = hardware. Correct.

Thread = how the hardware is supplied with information. Think of it as the 'road' by which the information gets into the CPU core.

Some processors, like the i7-2600K, have hyper-threading. This is where each core can take 2 threads. In layman's terms, although the CPU has 4 physical cores, it allows the CPU to act as if it had 8 cores. Generally only useful for high-intensity programmes that do modelling or video-editing work.
 

$hawn

Distinguished
Oct 28, 2009
854
1
19,060


A core is the hardware part , a single physical unit of the processor that can work on thread(s).

When software is executed, depending on how it was written/complied, it may contain 1 or more threads.


The core2 , phenom's,athlon's, pentium3 and older processors etc can handle only 1 thread/core

Some pentium 4's, and all 1st and 2nd generation 'core i' support hyper-threading, ie 2 threads/core , giving a slight boost in performance for almost free.
so, a core i3 for instance, has only 2 cores, but can handle 2x2=4 threads , and hence appears as a quad core to the OS.(4 logical cores)
 
  • Like
Reactions: Mr.Owl

$hawn

Distinguished
Oct 28, 2009
854
1
19,060
not true, the i5-2500 etc. dont have 2 threads per core. and many of the core 2 series have hyper-threading too. and they dont give a 'slight' boost, in some applications having 2 threads to one core can quite dramatically improve performance.

sorry my bad, forgot bout the quad i5's, yea they 4c/4t, and i never mentioned core2 having HT btw :)...
and yea...as for HT boosting performance,the dramatic stuff is mostly only in synthetic benchies, and in *SOME* day to day apllications:)
 

oby20

Distinguished
Mar 16, 2011
157
0
18,710
hi
cores are physical cores, threads are virtual cores, cores with 2 threads is called hyper threading technology, 2 threads/core makes the core work on two loads at same time. dual cores with 4 threads(hyper threading) is of course faster than dual cores w 2 threads only (no hyper threading). but this dual cores with 4 threads is still not as fast as 4cores with 4threads, because core has its own memory, so if you have a dual core with hyper threading, the core works with 2 loads each at same time because of the 2 threads per core, but this 2 threads will share memory in that core, unlike the 4 cores with 4 threads, they dont share memory because they have their own dedicated memory 1 core 1 thread, so the processing time is still faster than the 4cores with 4 threads, than the dual cores with 4 threads.
 
I'll try and dumb it down a bit:

CPU: The "brains" of the computer. Responsable for all computations, loading of data, etc

Core: An individual CPU unit. For instance, a Dual Core CPU can be thought of as having two seperate CPU's in a single package, with their own dedicated registers and cache. [This isn't entirely correct, but its a simlified explanation]

Process: A process can be thought of as a program. When you start a program, it kicks of its process, and all memory that is allocated is allocated at the process level.

Thread: A thread is a unit of execution within a process. One process can have many threads. For instance, you could have a thread to handle User Input, a thread for program control, a few threads for AI managment, a thread for audio, etc. All these threads exist within a single process.

Within most modern OS's, the thread is the smallest unit of execution; the OS schedules threads [usually based on priority], and the CPU spends some time operating on a thread, before swapping in a new one to work on [giving the illusion multiple things can happen at the same time].

On a multiple-CPU or multi-core system, multiple threads could be run at the same time, hence why there is an increasing focus on software parallelization.
 
Great explanations, it all comes down to Core is the brains of a computer or CPU. Each core can do one thing at a time. Threads are the number of programs/applications that you have running at once or the way that a program has been written in which it will break itself apart and send part to one core and part to another by doing this it increase the performance of a processor/CPU in most cases giving you 15% to 85% performance boost for each additional core or thread that the processor can run and that the application is designed to be broken into. Right now a good number of games can take advantage of up to 3 threads.
Hyper-threading is a technology that allows a second thread of information to enter the processor and take advantage of core resources that are not being used. While this won’t give you the full performance of an extra core it does give you a performance increase.

Christian Wood
Intel Enthusiast Team
 

ConradCA

Distinguished
Nov 16, 2009
8
0
18,510
Intel and AMD CPU chips have multiple cores and each core is an processor so they effectively are multi-procesor chips.

Most programs, such as excel, consist of a single process which has 1 address space and runs on 1 processor. Threads allow one process to use multiple processors (cores) to work on a single problem in order solve that problem faster.
 
Apr 14, 2013
1
0
10,510
think of an assembly factory(cpu)
with two processing robots(cores)
which working on items on belt(s)(thread)

at non-hyper threading, a processing robot can only serve a belt,
but hyper threading one can work on two belt.

note that the materials for processing are not always present at a belt.
and the robot can only process at a belt in one time
so, when there's none in one belt,
the robot moves to process material in another belt, and such

it does, speed up performance if there's a lot of processed stuff,
since the waves of materials to be processed are rather high,
and those loads of stuff can loaded in the belts

but if there barely any to process, it's just the same with the non hyper threading.

another example:
a route (cpu)
with two road (cores)
and trucks transporting stuff there(thread)


a hyper threading road have twice more trucks than non hyper threading one.
the trucks have the same speed

indeed, when both route given the maximum capacity of the hyper threading route, (used in video editing and stuff)
the hyper threading one is much faster.
but, there's congestion in the road, so that doesn't necessarily twice faster.

when both route given half of the capacity of non hyper threading route,
the speed is relatively same, cause the speed of the trucks are same

well something like that.
 

ChristmasPaul

Honorable
Sep 3, 2013
1
0
10,510
I understand the concept of multi-core processors and something about hyperthreading within the cores. I also understand parallel processing very well. What I don't know is how fast the processor can simultaneously run processes...

Here's an example:
You have one quad-core processor with no hyper-threading.
The processor is 3000 MHz
So, let's say, for simplicity, that you have ONLY 4 threads running at one (with an OS like Windows, that'll never happen). Also, let's assume that these are completely independent threads that don't depend on the results of the other threads and are using different areas of memory.
My question: Are you, in effect, achieving what a 12 GHz, single thread, processor can do? (if you wrote a single-thread program that accomplishes what the four threads were doing without any overhead).

Secondly, about hyperthreading.... This time let's assume it's the same quad-core processor running at 3.0 GHz but it has hyperthreading to allow 2 threads on each. I read some of the responses about there being a separate set of registers, etc. So it sounds like hyperthreading only eliminates the overhead of task-switching. Am I right?
So, a quad-core with 2 threads per core is still, effectively, 12 Ghz (with 8 independent threads running) but faster than a quad core with no hyperthreading because there is little to no overhead in switching tasks? It's not equiv. to a single-thread 24 GHz processor, right?

Thanks a bunch!
Paul
 

Jimbocous1

Distinguished
Oct 21, 2013
19
0
18,520


Not totally sure, but perhaps my experience will shed a little light on it. I run SETI@HOME on several machine. One is a Pentium-D dual core 3.40Ghz HP, and the other is a rather old Foxconn Pentium 4 Prescott (single core), also at 3.4 Ghz. Seti see both as having 2 CPUs, and where the HP handles two simultaneous jobs at about 1750 MFlops, the Foxconn handles 2 jobs at about 1480 MFlops. The other P4s I run will only process a single job at a time. I guess the multi-thread is considered as equivalent to another CPU for application purposes. I was certainly surprised to see Seti reporting 2 CPUs on the Foxconn, which led me to this message thread. I still don't know quite what to make of it all, but I certainly can't argue with the results.
 

German C

Commendable
Feb 20, 2016
2
0
1,510


 

German C

Commendable
Feb 20, 2016
2
0
1,510


YOUR EXPLANATION IS WAY TOO CONFUSING!