Comsci 2101 Chapter 4 Part 1
Comsci 2101 Chapter 4 Part 1
Comsci 2101 Chapter 4 Part 1
Chapter 4 Part 1
PROCESSOR MANAGEMENT
This is how the computer runs multiple processes simultaneously … you do a few steps on one
process, get interrupted, work on other processes, then return to the first process, remembering
where you left off from, and continue on.
What is a process?
The basic unit of execution in the operating system.
“Process” is the name we give to a program when it is running in memory
The application may be a program written by a user, or a system application.
Users may run many instances of the same application at the same time, or run many
different applications.
The process only exists for the duration of executing the application.
JOB SCHEDULER
We describe a collection of processes as a “job”.
When the operating systems is presented with a queue of jobs or processes to run, the
Job Scheduler has the task of deciding which order to run the jobs in.
The Job Scheduler wants to ensure that all components of the operating system are
busy, and there is no component that is idle.
I/O-bound process spends more time doing I/O than computations, many short CPU bursts
CPU-bound process spends more time doing computations; few very long CPU bursts
Sevile.
Xhage.
So, in this case the Job Scheduler wants to balance the jobs coming in, so that the components of the
operating system are all kept busy.
If we don’t change the order of job, the CPU will be very busy, but the I/O component will be
idle, and then vice versa.
This is not an optimal use of resources, so we swap them around.
Process Status Every process has a field that records their current status
When the process is first passed to the Job Scheduler from the operating system, its status is always
set as HOLD.
When the Job Scheduler passes the process onto the Process Scheduler, its status is always
changed to READY.
PROCESS SCHEDULER
assigns the CPU to execute processes of those jobs placed on ready queue by Job
Scheduler
After a job has been placed on the READY queue by Job Scheduler, Process Scheduler takes over.
Determines which jobs will get CPU, when, and for how long.
Decides when processing should be interrupted.
Determines queues job should be moved to during execution.
Recognizes when a job has concluded and should be terminated.
HOLD
READY
WAITING
RUNNING
FINISHED
Sevile.
Xhage.
Process Control Block (PCB) data structure that contains basic info about the job
Process identification
Process status (HOLD, READY, RUNNING, WAITING)
Process state (process status word, register contents, main memory info, resources, process
priority)
Accounting (CPU time, total amount of time, I/O operations, number input records read, etc.)
PCB of job created when Job Scheduler accepts it updated as job goes from beginning to
termination.
Sevile.