Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Process Scheduling of Operating systems

Rating
-
Sold
-
Pages
29
Uploaded on
30-12-2022
Written in
2021/2022

In these notes, Covered all the topics of operating systems briefly. COs - Analyze the structure of OS and basic architectural components involved in OS design. Compare and contrast various CPU scheduling algorithms. Evaluate the requirements for the process synchronization and co-ordination in the contemporary operating system. Analyze various algorithms for memory management, I/O management and security aspects of operating system. Write shell scripts in Unix/Linux O.S and write simple programs using kernel system calls. Also understand virtualization concept

Show more Read less
Institution
Course

Content preview

2 – Processes & Threads

(1) What is Process? Give the difference between Process and Program.
Process:
• Process is a program under execution.
• It is an instance of an executing program, including the current values of the pro-
gram counter, registers & variables.
• Process is an abstraction of a running program.


Process Program
A process is program in execution. A program is set of instructions.
A process is an active/ dynamic entity. A program is a passive/ static entity.
A process has a limited life span. It is A program has a longer life span. It is
created when execution starts and stored on disk forever.
terminated as execution is finished.
A process contains various resources A program is stored on disk in some file.
like memory address, disk, printer It does not contain any other resource.
etc… as per requirements.
A process contains memory address A program requires memory space on
which is called address space. disk to store all instructions.


(2) What is multiprogramming?
• A process is just an executing program, including the current values of the program
counter, registers, and variables.
• Conceptually, each process has its own virtual CPU.
• In reality, the real CPU switches back and forth from process to process, but to under-
stand the system, it is much easier to think about a collection of processes running in
(pseudo) parallel, than to try to keep track of how the CPU switches from program to
program.
• This rapid switching back and forth is called multiprogramming and the number of pro-
cesses loaded simultaneously in memory is called degree of multiprogramming.


(3) What is context switching?
• Switching the CPU to another process requires saving the state of the old process and

1

, 2 – Processes & Threads
loading the saved state for the new process.
• This task is known as a context switch.
• The context of a process is represented in the PCB of a process; it includes the value of
the CPU registers, the process state and memory-management information.
• When a context switch occurs, the kernel saves the context of the old process in its PCB
and loads the saved context of the new process scheduled to run.
• Context-switch time is pure overhead, because the system does no useful work while
switching.
• Its speed varies from machine to machine, depending on the memory speed, the num-
ber of registers that must be copied, and the existence of special instructions.




Figure 2-1. Context Switching


(4) Explain Process Model in brief.
• In this model, all the runnable software on the computer, sometimes including the op-
erating system, is organized into a number of sequential processes.
• A process is just an executing program, including the current values of the program
counter, registers, and variables.
• Conceptually, each process has its own virtual CPU.
• In reality, of course, the real CPU switches back and forth from process to process, but
to understand the system, much easier to think about a collection of processes running


2

, 2 – Processes & Threads
in (pseudo) parallel, than to try to keep track of how the CPU switches from program to
program.
• This rapid switching back and forth is called multiprogramming.
• In Fig. 2-2 (a) we see a computer multiprogramming four programs in memory.
• In Fig. 2-2 (b) we see four processes, each with its own flow of control (i.e., its own logi-
cal program counter), and each one running independently of the other ones.
• There is only one physical program counter, so when each process runs, its logical pro-
gram counter is loaded into the real program counter.
• When it is finished for the time being, the physical program counter is saved in the pro-
cess’ logical program counter in memory.
• In Fig. 2-2 (c) we see that over a long period of time interval, all the processes have
made progress, but at any given instant only one process is actually running.
• With the CPU switching back and forth among the processes, the rate at which a pro-
cess performs its computation will not be uniform and probably not even reproducible
if the same processes are run again.
• Thus, processes must not be programmed with built-in assumptions about timing.




Figure 2-2. (a) Multiprogramming of four programs. (b) Conceptual model of four inde-
pendent, sequential processes. (c) Only one program is active at once.


Process Creation
• There are four principal events that cause processes to be created:
1. System initialization.
2. Execution of a process creation system call by a running process.
3. A user request to create a new process.
4. Initiation of a batch job.


3

Written for

Institution
Course

Document information

Uploaded on
December 30, 2022
Number of pages
29
Written in
2021/2022
Type
Class notes
Professor(s)
Ymk sir
Contains
All classes

Subjects

$5.19
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
vaibhav51ppsv2020

Also available in package deal

Get to know the seller

Seller avatar
vaibhav51ppsv2020 C.K.Pithawala school of engineering and techonology
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
3 year
Number of followers
0
Documents
14
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions