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

Class notes 21cs208

Rating
-
Sold
-
Pages
44
Uploaded on
10-07-2024
Written in
2023/2024

compare to all notes better to understand

Institution
Course

Content preview

21CS208 – Operating Systems Unit-III

21CS208 – OPERATING SYSTEMS

UNIT III - PROCESS MANAGEMENT AND DEADLOCK

Process Management: Process Synchronization. CPU Scheduling: Scheduling Criteria,
Scheduling Algorithms. Deadlock: System Model, Characterization, Deadlock Detection,
Deadlock Prevention, Deadlock Avoidance, Deadlock Recovery.

----------------------------------------------************------------------------------------------------

Text Book: Abraham Silberschatz, Peter Baer Galvin and Greg Gagne, “Operating System
Concepts”, 9thEdition,John Wiley and Sons Inc., 2018.

3.1 Process Management
A process is an instance of aprogram in execution.
• An operatingsystem executes avarietyof programs:
1. Batch system – jobs
2. Time-shared systems – user programs or tasks The Process
• Process memoryisdivided into four sections.
1. The program code, also called text section
Current activity including program counter, processor registers
2. Stack containing temporary data
Function parameters, return addresses, local variables
3. Data section containing global variables
4. Heap containing memory dynamically allocated during run time
A Process in memory




• A program is a passive entity, such as a file containing a list of instructions stored on
disk (often called an executable file).


• A process is an active entity, with a program counter specifying the next instruction to
execute and a set of associated resources.
1

,21CS208 – Operating Systems Unit-III

• A program becomes a process when an executable file is loaded into memory.
• As a process executes, it changes state.
• The state of a process is defined in part by the current activity of that process.
• A process maybe in one of the following states:
1. New The process is being created.
2. RunningInstructions are being executed.
3. Waiting The process is waiting for some event to occur (such as an I/O
completion or reception of a signal).
4. Ready The process is waiting to be assigned to a processor.
5. Terminated The process has finished execution.
Process State




• It is important that only one process can be running on any process or at any instant.
• Many processes maybe ready and waiting.

Process Control Block


• Each process is represented in the operating system by a process control block
(PCB)—also called a task control block.
• The PCB simply serves as the repository for any information that may vary from process
to process.
• It contains many pieces of information associated with a specific process.




ProcessControlBlock


2

,21CS208 – Operating Systems Unit-III




• Process state - The state maybe new, ready, running, waiting, halted, and so on.
• Program counter - The counter indicates the address of the next instruction to be
executed for this process.
• CPU registers - The registers vary in number and type, depending on the computer
architecture. They include accumulators, index registers, stack pointers, and general-
purpose registers, plus any condition-code information. Along with the program
counter, this state information must be saved when an interrupt occurs, to allow the
process to be continued correctly afterward.


CPU switches from process to process




3

, 21CS208 – Operating Systems Unit-III

• CPU- scheduling information. This information includes a process priority, pointers
to scheduling queues, and any other scheduling parameters.
• Memory- management information. This information may include such items as the
value of the base and limit registers and the page tables, or the segment tables,
depending on the memory system used by the operating system
• Accounting information. This information includes the amount of CPU and real time
used, time limits, account numbers, job or process numbers, and so on.
• I/O status information. This information includes the list of I/O devices allocated to
the process, a list of open files, and so on.


Process Scheduling
• The objective of multi programming is to have some process running at all times, to
maximize CPU utilization.
• The objective of time sharing is to switch the CPU among processes so frequently that
users can interact with each program while it is running.
• Process scheduler–selects an available process (possibly from a set of several
available processes) for program execution on the CPU.
• Scheduling Queues
• Job queue– set of all processes in the system
• Ready queue– set of all processes residing in main memory, ready and
waiting to execute. This queue is generally stored as a linked list. A ready-
queue header contains pointers to the first and final PCBs in the list. Each
PCB includes a pointer field that points to the next PCB in the ready queue.
• Device queues– set of processes waiting for an I/O device. Each device has its
own device queue
• Ready Queue and various I/O device Queues
Schedulers
• A process migrates among the various scheduling queues throughout its lifetime. The
operating system must select, for scheduling purposes, processes from these queues in
some fashion.
• The selection process is carried out by the appropriate scheduler.
• Long-term scheduler (or job scheduler)–selects which processes should be brought
into the ready queue from the pool

4

Written for

Institution
Course

Document information

Uploaded on
July 10, 2024
Number of pages
44
Written in
2023/2024
Type
Class notes
Professor(s)
Kiran kumar
Contains
All classes

Subjects

$8.49
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
praveenkumar.m1

Also available in package deal

Get to know the seller

Seller avatar
praveenkumar.m1 Velammal college of engineering and technology
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
1 year
Number of followers
0
Documents
5
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