Programs, Processes, and Threads

Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
or

Already have an account? Sign In »

Time
15 hours 43 minutes
Difficulty
Advanced
CEU/CPE
16
Video Transcription
00:00
>> It's relevant here to talk about
00:00
programs, processes, and threads,
00:00
and understand how
00:00
those impact operating system performance and how
00:00
our hardware architecture is going to
00:00
determine how our operating system is able to process.
00:00
Let's take a look at the difference
00:00
>> between these three.
00:00
>> Sometimes you'll hear them used
00:00
interchangeably and that's really not accurate.
00:00
Like I said, we'll talk about the hardware that's
00:00
necessary to make this work within the operating system.
00:00
I have a little list of
00:00
some definitions. Let's look at these.
00:00
The easy one is a program,
00:00
a program is an application.
00:00
You go out and buy Microsoft Word,
00:00
>> there's your program.
00:00
>> You buy a game, there's your program.
00:00
Now once you open up that program,
00:00
it gets loaded into RAM,
00:00
it becomes a process.
00:00
Programs and anything else in RAM,
00:00
utility services, whatever, anything
00:00
loaded into RAM is a process.
00:00
Now, threads are
00:00
the individual instructions within a process.
00:00
For instance, if you have Word,
00:00
it's a program, you open Word up, it's a process.
00:00
Now, once I'm working in Word, I can print,
00:00
I can insert files,
00:00
I can change shapes,
00:00
I do all of these different things.
00:00
Those are individual threads.
00:00
Now, how operating systems
00:00
have worked with this over the years,
00:00
way back in the day of Windows 3.1,
00:00
which is really the last multi-programming system
00:00
that most people have seen.
00:00
The idea is it looks like you have
00:00
multiple programs open at the same time.
00:00
But really there's
00:00
only one application that's truly running.
00:00
The reason for that is in
00:00
those old multi-programming systems,
00:00
they didn't have a way to truly isolate resources.
00:00
They didn't have a way of saying,
00:00
>> okay, Microsoft Excel,
00:00
>> this is your amount of memory,
00:00
PowerPoint, this is your amount.
00:00
Whatever your web browser,
00:00
since we're talking old school
00:00
might as well say Netscape,
00:00
this is your amount of RAM.
00:00
They didn't have that true applications,
00:00
they were all working out of the same space.
00:00
This used to be called co-operative
00:00
multi-programming because the idea is,
00:00
it was up to the applications
00:00
to be written to play nicely together.
00:00
If they weren't playing nicely together,
00:00
there wasn't much you could do about it.
00:00
You could reboot the system and try again.
00:00
Now with Windows 95
00:00
became what we refer to as preemptive multitasking,
00:00
we're just multitasking is fine.
00:00
The idea is every process has its own amount of RAM,
00:00
processor time of resources that it
00:00
needed access to configuration files or whatever.
00:00
We had that true isolation
00:00
and that's when we were able to,
00:00
rather than just reboot,
00:00
that's when we started being able
00:00
to just shut down processes.
00:00
Back in the day with multi-programming systems,
00:00
if you were in
00:00
Internet Explorer and it locked up your system,
00:00
you had to totally reboot.
00:00
But with true multitasking systems,
00:00
I can shut down just individual operations
00:00
because they have their own unique access.
00:00
Now, multithreading,
00:00
I skip multiprocessing for saying I
00:00
just want to talk about multithreading first.
00:00
In multithreading, not only did you have
00:00
multiple processes running simultaneously,
00:00
but I could be running multiple instructions.
00:00
I could be downloading a file at the same time
00:00
I'm inserting an image.
00:00
I could have these threads running at the same time.
00:00
Now, we had that in our operating systems.
00:00
The operating systems were the
00:00
first to incorporate multithreading.
00:00
But the problem is if we don't have the right hardware,
00:00
it doesn't really matter that
00:00
our operating systems support
00:00
multithreading if our hardware doesn't.
00:00
Back in the day, we would have what
00:00
we refer to as symmetric multiprocessing,
00:00
which meant we would have
00:00
more than one processor in a system,
00:00
and all of those processors would work
00:00
together as a logical unit,
00:00
but I might have eight processors in a system or
00:00
16 or 32 or whatever I needed.
00:00
There was also asymmetric multiprocessing where you had
00:00
these multiple processors and each one
00:00
could be working or assigned to a specific function.
00:00
But the bottom line is for true multithreading,
00:00
you needed multiple CPUs.
00:00
That's where the multi-core processors
00:00
that we use today come in.
00:00
Rather than having eight individual processors
00:00
or four individual processors,
00:00
I have the multi-core.
00:00
On a single system,
00:00
a single processor, I have more than one core.
00:00
That is the hardware
00:00
that we need to conduct multithreading.
00:00
We talked about programs which are applications.
00:00
Once they're loaded into RAM,
00:00
they become processes in
00:00
the individual instructions are threads.
00:00
We also covered the idea of multitasking,
00:00
multi-programming, and multithreading.
Up Next