Week 04
Week 04
Systems:
Internals Week-4
and Design
Principles Operating System
Overview
Operating
Systems:
Internals
and
Design
Principles Threads
Processes and Threads
Resource Ownership Scheduling/Execution
Process includes a Follows an execution path
virtual address space to that may be interleaved with
hold the process image other processes
the OS performs a a process has an execution state
protection function to (Running, Ready, etc.) and a
prevent unwanted dispatching priority and is
interference between scheduled and dispatched by the
processes with respect to OS
resources
Processes and Threads
The unit of dispatching is referred to as a thread or
lightweight process
The unit of resource ownership is referred to as a
process or task
Multithreading - The ability of an OS to support
multiple, concurrent paths of execution within a single
process
Single Threaded Approaches
A single thread of
execution per process,
in which the concept of
a thread is not
recognized, is referred
to as a single-threaded
approach
MS-DOS is an
example
Multithreaded Approaches
The right half of Figure
4.1 depicts
multithreaded
approaches
A Java run-time
environment is an
example of a system of
one process with
multiple threads
Processes
The unit or resource allocation and a unit of protection
A virtual address space that holds the process image
Protected access to:
processors
other processes
files
I/O resources
One or More Threads
in a Process
User Level
Thread (ULT)
Kernel level
Thread (KLT)
User-Level Threads (ULTs)
All thread
management is done
by the application
The kernel is not
aware of the
existence of threads
Process and Thread
Objects
Windows makes use of two types of process-
related objects:
Processes Threads
• an entity • a dispatchable
corresponding to unit of work that
a user job or executes
application that sequentially and
owns resources is interruptible
Table 4.3
Windows
Process
Object
Attributes
(Table is on
page 175 in
textbook)
Table 4.4
Windows
Thread
Object
Attributes
(Table is on page
175 in textbook)
Multithreaded Process
Achieves concurrency
without the overhead of
using multiple processes