Instructor: In this lesson,
we are going to cover CPU features.
This includes things like multithreading,
symmetric multiprocessing,
single core versus multi-core and virtualization support.
Now, the first thing we're going to cover
is known as multithreading, also referred to as either SMT
or simultaneous multithreading or hyper-threading,
depending on which CPU you buy.
Hyper-threading is a term that's used
by Intel for this process.
And the more generic term is SMT,
or simultaneous multithreading.
Now, when you're dealing with threading,
this is the concept of a single stream of instructions
that's being sent by a software application to a processor.
Now, most applications were designed to run a single process
in a single thread.
And this means that that software does everything
in a serial manner.
So, if I gave you an instruction
of five different things to do
you would do those things in order,
one, two, three, four, and five.
And if each one of those took you 10 minutes,
that would be a total of 50 minutes.
But if I could allow you to do multithreading
and do those things out of order
or do them at the same time, you could then do
more than one thing at a time by sending these things
to different threads or different streams.
For example, let's say I told you
that I wanted you to write something down
with your right hand,
and at the same time, I wanted you to tap the desk
with your left hand.
You could do both of those at the same time,
because you have two threads,
or two hands to do those actions.
This is the idea of multithreading.
And so, what Intel and the other manufacturers did
was develop a way to allow software
to talk to their processors and run
multiple parallel threads at the same time
within that single processor.
This allows these threads to be run
through that processor and reduce the amount of time,
of idle time, that CPU is sitting there
waiting for the next action.
By doing this, we essentially can try to
increase our capability
and get more things through the processor
and try to attempt to get more things done
during the same amount of time.
Now, that's great, but it only works to a certain point,
and the software has to be able to use that
and understand that to be able to tell the system
that you want to use multiple threads at the same time.
This is the big limitation
when you're dealing with something like hyper-threading.
Now, another way to get past this
is what's known as doing symmetric multiprocessing, or SMP.
Now, SMP is the traditional way
that workstations and servers did this,
because they actually had multiple processors.
Now, to do this, you have to have a motherboard
that has two processor sockets or four processor sockets,
and then you'd install two or four processors
into that motherboard.
When you do this, all of those processors
need to be the same type and speed
so they can work together.
And your underlying operating system has to understand
how to use more than one processor.
By default, most operating systems didn't do that.
And so, you had to have a server based operating system
like Windows Server 2019, to be able to support
multiple processors.
Because of this, SMP or symmetric multiprocessing,
was not very useful in desktops and laptops.
And instead, most desktops and laptops had to instead rely
on hyper-threading by Intel processors
or simultaneous multithreading, or SMT,
if you're using an AMD processor.
So, hyper-threading and SMT worked really well
for a long time, but eventually we still hit a limit
of how much stuff we wanted to process
and only having that single processor to do it.
Now, because most operating systems didn't know
how to handle multiple sockets
or multiple processors on a given motherboard,
manufacturers started creating what is known
as a multi-core package.
Now, when I refer to a package,
I'm talking about the CPU, the physical chip.
Now, instead of having two physical packages
or two physical chips on two different sockets
on your motherboard,
what these manufacturers decided to do was
create a single package that operated as a single CPU.
But inside of that package,
there was actually multiple CPUs or multiple processors.
This meant that to the motherboard, it looked like
one physical CPU because it was, but inside of it,
there was multiple cores,
or central processing unit cores, inside of it.
Now, this allows any operating system
to talk to that single processor or processor package,
and then the processor package itself
could then divide out those instructions
among the internal multi-cores inside of that CPU.
Think about it this way.
You have a house that has four bedrooms.
If somebody comes to the front door and they say,
I need a bed for the night,
they really don't care which of those four they get
as long as they have a bed for the night.
And so, you enter the front door,
take them into a single room and only show them one room.
That's essentially what this multi-core processor is doing.
As new people come in the door, it takes them
to a single room and lets them sleep there for the night,
or do their processing, and then it sends them out again.
All of that is being handled
by the person at the front door,
which, in this case, is that multi-core package.
And then, it puts them into the individual compartment
or individual sub processor that it needs to do that work.
That's the idea of a multi-core package.
Now, most of us have heard of this before,
because, on your system,
you probably have a multi-core processor.
You probably have a dual-core processor,
which means you have two CPUs inside a single chip,
or you have a quad processor,
which means you have four processors
inside of a single chip.
Or you have a hexa processor,
which means you have six cores inside of a single chip.
Or you have an octa processor,
which means you have eight cores in a single chip.
For example, on my CPU, I have an eight core processor
on my desktop computer, and it's one physical chip,
but it has eight sub processors inside of it.
And so, this is known as an eight core,
or multi-core processor.
Now, in addition to having multi-core
and having hyper-threading,
you can actually combine the two
so each of those processors inside of the package,
for example, in my system
I have the octa-core, which has eight processors.
Now, inside that one package,
there are eight processors,
and each of those eight processors
can also support hyper-threading.
This means I have 16 threads with eight CPUs,
giving me a ton of processing capability
on that particular machine.
All right, so, at this point we have talked about
three of the four things we wanted to cover in this lesson.
We've talked about hyper-threading
and simultaneous multithreading, known as SMT.
We've talked about symmetric multiprocessing,
or having multiple CPUs in sockets,
and then we talked about this idea of multi-core processors,
where you have a single CPU
which has multiple processors inside of it,
whether it's two, four, six, or eight of them.
Now, the last thing we need to talk about is virtualization.
Now, virtualization is kind of another feature of CPUs,
but it doesn't really relate to the three
we just talked about.
The three we just talked about was all about
how you get more performance out of a single chip
or multiple chips.
But when we talk about virtualization,
what we're talking about is being able to emulate
that there's hardware there that really doesn't exist.
Now, this is actually achieved
either through Intel's virtualization technology,
known as VT or AMD's virtualization,
which is known as AMD-V.
Now, both of these provide processor extensions
to support virtualization, which is referred to
as hardware assisted virtualization.
And this probably brings up the point,
what is virtualization?
Well, virtualization is the ability to have a computer
pretend that it's running multiple other computers
inside of itself.
Now, what this looks like is,
I might have a single laptop like my MacBook.
And in that MacBook, I have one operating system, macOS.
Now, if I wanted to run Windows or Linux,
I would have to reformat my machine
and install that software.
That would be really inconvenient.
But with virtualization, I don't have to do that.
Instead, I can run a program
like VMware or Virtualbox or Parallels,
and inside of that software,
I can create a virtual computer.
I can tell it that I want it to have one processor
or two processors or four processors.
And I can tell it how much memory I want
and how much storage I want.
And it will create this virtual computer
that is only exists in the software.
Now, when I run the new operating system, like Windows,
inside of it, I might say that this is a two core processor.
It has four gigabytes of RAM and a 50 gigabyte hard drive.
All that exists only in software.
But when I install Windows into that virtual machine,
Windows thinks it's a full computer.
It thinks it has a full two processors,
a full four gigabytes of memory
and a full 50 gigabyte hard drive.
And so, to Windows,
it thinks it has all this physical hardware,
and that's what virtualization allows us to do.
It allows us to virtualize a computer
and give virtual hardware
and be able to run multiple operating systems
inside of a single physical host.
Now, in addition to VT and AMD-V,
there's also a second level
of virtualization hardware support that you can look for
in some modern processors.
On Intel systems, this is known as EPT,
or extended page table.
And when you're dealing with an AMD processor,
they call this rapid virtualization indexing, or RVI.
Both of these are considered to be second level
address translation or SLAT features
of software virtualization that are then underlying
and supported by that hardware processor
to allow better virtual memory management
and give you increased performance
when it comes to using memory inside of a virtual machine.
We're going to talk a lot more about virtualization
in their own lessons, but for now,
I just want you to understand
that some CPUs have the ability to do this
inside of their processor set,
and the processors that have that capability,
such as those that support VT by Intel or AMD-V from AMD,
will give you better performance
when you're doing virtualization than ones that don't.
So, if you're going to be building a machine
and you want to use it for virtualization,
such as a server that's going to run
a lot of other virtual servers on it,
you want to make sure the processors you select
have either VT or AMD-V so they can support
direct hardware accelerated virtualization,
'cause that will give you a much better experience
and much better performance
than if you're having to do software virtualization instead.