Articles

Difference Between Physical Cores and Logical Processors

Difference Between Physical Cores and Logical ProcessorsProcessor jargon can get quite confusing. There are physical processors, cores, threads, context switches, logical processors let alone all the other aspects like the cache, TDP, clock speed etc.

So what is the difference between Physical Cores and Logical Processors? Well as the name suggests, physical cores are just that, they are physical units on a CPU. Whereas, logical processors are a software abstraction.

Logical processors are also related to threads. They are enabled by the hyper-threading technology incorporated on select Intel Processors (Hyper Transport on AMD).

With hyper threading enabled, you essentially get two threads per core.

So if you have a 6 core processors like the Intel Core i7-8750H processor WITH hyper threading enabled, you essentially get 12 threads running simultaneously. Therefore, you can say you have 12 logical cores.

Therefore, in short, Logical cores are the number of Physical cores times the number of threads that each core can run. With Hyper-threading, each physical core can run two threads.

I know that is a lot of jargon.

So let us look at what each of these terms mean separately.

Also Read: Do more cores means a better performance?

Understanding the Difference Between Physical Cores and Logical Processors

More Physical Cores vs More Logical Processors

A logical processor DOES NOT increase the number of physical cores that you have. Logical processors are just a way of increasing the efficiency of your present cores. They do not increase their number or the speed at which they process information.

As a RULE OF THUMB, remember this: More physical cores is ALWAYS better than a higher number of logical cores.

You may be tempted to buy a processor that has 2 physical cores plus 2 additional threads giving you a total of 4 logical processors. However, this is not the same as having 4 physical cores.

In other words, a dual core processor with hyper-threading enabled is less powerful than a quad core processor with no hyper-threading enabled.

We recommend reading the rest of the article as it briefly explains all the essential jargon.

What is a Core?

A core is a physical entity on a CPU. Before there were cores, there never was any worry about how many cores a processor has and what not. Back then each processor had a single set of “components” such ALU, registers, cache etc.

Nowadays, things have become fairly more complicated. Almost all processor have at least two cores. Each of the cores have a separate ALU, registers and Cache.

CPU_vs_CORE

This image shows a great representation of a processor architecture. As you can see this processor has four cores each with its own cache. Inside, each would have its own set of components and circuitry.

Each core can have speeds ranging from 1 GHz base speed all the way to 3 GHz base speed. The Intel Celeron processors, for example, have a base speed of 1 GHz per core. On the other than, the Intel Core i7 processor can have about 3.5 GHz of base clock speed per core and a Turbo Frequency of 4.90 GHz per Core.

Turbo Frequency kicks in when you are running high demanding tasks like gaming. However, when the processor goes into ideal state or when working on low demanding tasks like word processing, it goes back to base frequency. It does this to reduce heat generated and the power consumed.

Now the questions arises

Why Have So Many Cores Instead of One Powerful Single Core Processor?

This was generally the case prior to the introduction of cores. For example, Pentium II, flagship processor of 1997 had a single core. It had improved drastically in terms of clock speed in comparison to Pentium I. Similarly, Pentium III, flagship processor of 1999, improved on the clock speed of the Pentium II.

So why introduce more cores?

Heat

Eventually the improvement in clock speed reached a physical limitation. They just could not be cooled effectively enough to maintain an accurate performance. Plus they would just be consuming a lot of power to be feasible.

This gave rise to the cores. The idea here was that two cores operating at slower speeds would use less power and generate less heat compared to a single core operating at super fast speed.

Multitasking

context-switching

Context Switching

Along with the heat issues, another problem with the single core processor was the lack of multitasking ability.

There is a thing called Context Switch Overhead. A context switch happens when a CPU has to switch from one task to another. Therefore, if you are typing something on Microsoft word and you suddenly switch to your Internet browser, the processor has to switch to an entirely different process. This degrades the performance.

Therefore, in terms of efficiency, a single core processor would have to be extremely fast and power consuming to match the performance of a multi core processor running at a slower clock speed. Basically, it would have to have the power to compensate for the context switch overhead.

The simplest multicore processors can handle as many threads (processes) as the number of cores they have.

Threads

It is worth defining threads here. This a fairly simple concept, but essential in understanding what Logical Processors are.

Threads (processes) are basically a set of data delivered by a certain program to the processor. For the purpose of explanation consider thread as a single program running on the computer like Skype, or Microsoft Word.

A single core processor can only handle a single thread at a time. So if you switch from the Skype thread to the Microsoft Word Thread on a single core processor, you will incur the Context Switch Overhead penalty.

In order to switch from one thread to another, the single core processor has to be extremely fast to make a seamless transition. No one wants their computer to lag. So in order to to perform this smooth transition, it would need to consume a lot of power to compensate for the Overhead caused by the Context Switch. This again generates heat.

However, multi-core processors have multiple threads. Each core can handle a separate set of data from a different program. So in the instance where you have two cores and two programs running simultaneously, each core would handle a single thread separately. Therefore, transitioning between the two would be very smooth.

Let alone the fact, that the processor would be running cool and quite at the same time because the cores wouldn’t have to worry about switching i.e removing the current thread and then loading up the resources of the next thread when you make the switch.

Therefore, multiple cores are essential for multitasking. The more threads you have, the more concurrent tasks you can perform.

As a rule of thumb, # of Threads = # of Cores. UNLESS, your processor supports Hyper-Threading in which case # of Threads > # of Cores

You can easily check the amount of threads or logical processors currently running on your computer by going to the Task Manager -> Performance -> Right Click -> Logical Processors. (Windows 10)

logical processors

4 Core processor with 8 Threads (8 Logical Processors)

Also Read: How may threads can a Quad Core processor handle?

Logical Processors and Hyper-Threading

Now that you have a basic idea about what a Core and a Thread is, it is time to talk about what Logical Processors are and what is their relationship to Hyper-Threading.

A logical processor is an abstract processor made completely out of software programming. However, the operating system PERCEIVES it to be a separate physical processor.

Essentially if you have a processor with Hyper-Threading enabled, the logical processors you have would be twice the amount of physical cores. In the end, you end up with two threads per core.

You must note that not all Intel Processor have Hyper-Threading feature.

This video by Linus explains Hyper-Threading in perfect language and in doing so, essentially explains what Logical Processors are.

The analogy he uses in the video is your “mouth” eating “food” with “two hands”. Mouth here represents a “core” whereas the food is the “process/task”.

If your mouth was a single core processor without hyper-threading enabled, then the way you eat would look something like this.

  1. Grab food with single hand and put it in your mouth
  2. Chew the food
  3. WAIT till its chewed
  4. Make sure it is ingested
  5. Then extend your hand for another bite

If your mouth was a single core WITH hyper-threading enabled, then the way you eat would look something like this.

  1. Grab food with single hand and put it in your mouth
  2. At the same time use the other hand to grab another bite.
  3. While you are about to finish chewing, bring the food in your second hand to your mouth.
  4. Simultaneously, use the first hand to go for another grab at the food.
  5. And the process continues

Therefore, hyper-threading or logical processors essentially schedule the tasks on a core. This makes processing the task more efficient.

It doesn’t necessarily make the core any faster, it just makes it more efficient.

It most certainly DOES NOT double the number of cores you have.

Does Hyperthreading Always Help?

No, as Linus explains in the video above. Hyper-threading cannot help with single-threaded workloads. In fact, even multiple PHYSICAL cores wouldn’t be able to help you with single-threaded workloads.

For examples, older games are notoriously famous for using only a single core and a single thread. This way, hyper-threading wouldn’t matter much. However, newer games are becoming more and more multi-threaded in nature.

On the other hand, Hyper-Threading can work wonders with Multiple-Threaded Workloads like image processing or rendering of an animation. If you are a professional editors or a designer, then you absolutely need to go for as many physical cores as possible and make sure it has Hyper-threading so tat you get a lot of logical processors.