0% found this document useful (0 votes)
6 views15 pages

Module3-CCS2203-Operating Systems (Part 1)

Module 3 of the Operating Systems course focuses on process management, covering process features, states, creation, termination, and scheduling. It distinguishes between preemptive and non-preemptive scheduling, detailing various CPU scheduling algorithms and their efficiencies. The module also outlines the roles of different types of process schedulers and the circumstances under which processes are created and terminated.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views15 pages

Module3-CCS2203-Operating Systems (Part 1)

Module 3 of the Operating Systems course focuses on process management, covering process features, states, creation, termination, and scheduling. It distinguishes between preemptive and non-preemptive scheduling, detailing various CPU scheduling algorithms and their efficiencies. The module also outlines the roles of different types of process schedulers and the circumstances under which processes are created and terminated.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CCS 2203

OPERATING SYSTEMS
Module 3 – Process Management (Part 1)
LEARNING OUTCOMES:
 Describe the various features of processes,
including scheduling, creation and termination,
and communication.
 Differentiate between preemptive and non-
preemptive scheduling.
 Learn how to calculate the different CPU
Scheduling algorithms.
 Learn how to calculate the efficiency of some
CPU Scheduling algorithms.
PROCESSES
- A process is defined as an entity which represents the basic unit
of work to be implemented in the system.
- Are programs loaded into memory that take alternating CPU
and I/O bursts

 CPU burst – simply means that it is doing CPU


processing.
 I/O burst – refers to the program doing input or output
activity.

- It is either doing an input or output activity and a


processing activity.
PROCESS STATES
1. Two-state process model – the alternating CPU and
I/O bursts of a process
- As exemplified by the on and off state of a switch.
2. Three – state process model – which reposes on the
idea that aside from the state whereby the process is
running or processing inside the CPU, the process is
either waiting to get into the processor or busy doing
I/O activities

It shows three stages a job must pass through:


 Execution in the processor

 Completion of I/O

 Preparation for CPU allocation inside the memory


PROCESS STATES (CONT…)
3. Five-state process model – depicts the birth of a
process in new state and the death of a process in the
terminated state.

Image Source: https://www.cs.uic.edu/~jbell/CourseNotes/OperatingSystems/3_Processes.html


PROCESS CREATION AND TERMINATION
Process creation inside the computer system, are
created under the following circumstances:

1. System Boot-up – when the power button of the


computer is pressed the computer system is
initialized. All system processes that must be
initialized in preparation for the loading of user
applications are initialized during the booting process.
2. Batch System Initiation – in a batch processing
system, the OS makes the initiative to run the next job
in the batch the moment it sees that all required
resources are available.
PROCESS CREATION AND TERMINATION

3. Human User Creation – another process creation


situation is when the user decides to create a process
either through a double click of an existing file-shortcut on
the desktop or saving a new document file on the word
processor with the file name you want. In both instances,
a process is created in memory.

4. Process Spawning – is a technique in which OS


creates a child process by the request of another
process.
In this method, a process is called by another
application during its execution. The summoning
process is referred to as the parent processing while the
summoned is called the child process.
Process termination, in the computer system,
takes many forms. Stallings (2001) gives us the following
situations when a process dies or terminated:

1. Normal Completion – a process informs the OS that it has


finished its execution.
2. Time Limit Exceeded – the process is terminated the moment it
exceeds the maximum time for a user to perform input.
3. Memory Unavailable - a process is terminated whenever there
is insufficient memory availability than what is being required by
the user application.
4. Bounds Violation – in a networked environment, access to a
common “shared “location is common to all users. A restricted
area, on the other hand, is limited to user accounts with unlimited
access rights, such as an administrator. If an ordinary user would
therefore try to access a restricted location in the network, such
attempt would be failed due to his limited access rights. The
boundary he is looking into is beyond his defined scope and is
therefore creating a violation.
5. Protection Error – this process termination event
occurs when a process tries to access a protected file or
resource.
6. Arithmetic Error – this type of process terminating
error occurs whenever an illegal computation is made in
the computer system, such as undefined computation or
an extremely large numerical input to a limited capacity.
7. Time overrun – occurs when a process has consumed
the maximum time waiting for an event to happen.
8. I/O Failure – occurs when an error is encountered in
an I/O device
9. Invalid Instruction – the process executes a
nonexistent instruction.
10. Privilege Instruction – there are instructions which
are considered reserved words and are therefore limited
for system users such as the OS.
11. Data Misuse – occurs when data is of the wrong type
or not properly initialized in the system.
12. Operator or OS intervention - this is common in a
deadlock situation.
13. Parent Termination – when a parent process
terminates, the child process or children processes are
likewise terminated in what is termed as cascading
termination.
14. Parent Request – a parent process has the authority
to terminate any of its offspring processes.
PROCESS SCHEDULERS
Processes moves from one state to another with
the help of the process schedulers. There are three types
of process scheduler namely:
1. Long-term Scheduler – also known as Job
scheduler, controls the degree of multiprogramming or
the number of jobs that get inside the memory from
the secondary storage device.
2. Short-term Scheduler – also called the CPU
scheduler or Dispatcher, selects job from the main
memory to be allocated to the CPU on a one-at-a-time
basis.
3. Medium-term Scheduler – also called Swapper,
removes a job from the main memory in order to
create a vacancy in the memory where the needed
process can be loaded.
PREEMPTIVE AND NON-PREEMPTIVE PROCESS

Processes in the computer system can be


considered either as preemptive or non-preemptive.

Non-Preemptive process – is a process which does not


relinquish the CPU until its last CPU burst is exhausted.

Different types of Non-Preemptive CPU scheduling Algorithms


1. First Come First Serve (FCFS)
2. Shortest Job First (SJF)
3. Non-Preemptive Priority (NPP)
Preemptive – on the other hand, is capable of being
interrupted by another process while inside the processor.

Different types of Preemptive CPU scheduling Algorithms

1. Preemptive Priority (PPrio)


2. Shortest Remaining Time First (SRTF)
3. Round Robin (RR)
4. Round Robin with Overhead (RRO)
REFERENCES:
Textbook References:
• Abraham Silberschatz, Greg Gagne, and Peter Baer Galvin, "Operating
System Concepts, Ninth Edition”
• Silberschatz, A. (2010). Operating system concepts. Hoboken, NJ : Wiley
• Silberschatz, A., et al (2009). Operating system concepts. Hoboken, NJ :
Wiley

Articles / Online:
• Processes [Retrieved from:
https://www.cs.uic.edu/~jbell/CourseNotes/OperatingSystems/3_Processes.
html ]
• Process Termination in OS [Retrieved from:
https://t4tutorials.com/process-termination-in-operating-systems/ ]
Journal/s:
• R.R. Guada˜na, M.R. Perez, L. Rutaquio, Jr., A comprehensive review for
central processing unit scheduling algorithm, International Journal of
Computer Science Issues 10(1) (2013) 353–358
END OF MODULE 3 – PART 1

You might also like