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

Processes

Rating
-
Sold
-
Pages
30
Uploaded on
19-06-2024
Written in
2023/2024

Easy notes that helps to learn about processes

Institution
Course

Content preview

CST 206 OPERATING SYSTEMS
MODULE 2

Processes - Process states, Process control block, threads, scheduling, Operations on
processes - process creation and termination – Inter-process communication - shared
memory systems, Message passing systems.
Process Scheduling – Basic concepts- Scheduling criteria -scheduling algorithms- First
come First Served, Shortest Job First , Priority scheduling, Round robin scheduling.

PROCESS CONCEPT
An operating system executes a variety of programs:
• batch system – jobs
• time-shared systems – user programs or tasks.
• Process is a program in execution, its execution must progress in sequential fashion.
• A program is static and passive whereas a process is dynamic and active.
• One program can be several processes (e.g., multiple instances of browser).The process can be started
via GUI or command line entry of its name.
A process has multiple parts:
• the program code, also called text section
• runtime CPU states, including program counter, registers, etc.
• various types of memory:
stack: temporary data e .g., function parameters, local variables, and return addresses
data section: global variables
heap: memory dynamically allocated during runtime
Process in Memory




Figure 1: Process in Memory
PROCESS STATE
As a process executes, it changes state
• new
• ready
• running

1

, CST 206 OPERATING SYSTEMS
• waiting
• terminated
1. Start/ New
This is the initial state when a process is first started/created.
2. Ready
The process is waiting to be assigned to a processor. Ready processes are waiting to have the
processor allocated to them by the operating system so that they can run.
3. Running
Once the process has been assigned to a processor by the OS scheduler, the process state is set to
running and the processor executes its instructions.
4. Waiting
Process moves into the waiting state if it needs to wait for a resource, such as waiting for user input,
or waiting for a file to become available.
5. Terminated or Exit
Once the process finishes its execution, or it is terminated by the operating system, it is moved to the
terminated state.
Diagram of Process State




Figure 2: Process States and Schedulers
PROCESS CONTROL BLOCK (PCB)
In the kernel, each process is represented by a Process Control Block (PCB).It is also called a task control
block .It contains:
• process number (pid)
• process state
• program counter
• CPU registers
• CPU scheduling information
• memory-management data
• accounting data
• I/O status
2

, CST 206 OPERATING SYSTEMS
Process state : The state may be new, ready, running, waiting, terminated, 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, any condition-code
information.
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, 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.
Figure 3: PCB
SCHEDULING QUEUES
• Kernel maintains scheduling queues of processes:
• job queue: set of all processes in the system.
• ready queue: set of all processes residing in main memory, ready and waiting to execute.
• device queues: set of processes waiting for an I/O device.
• Processes migrate among the various queues.
• For a single-processor system, there will never be more than one running process. If there are
more processes, the rest will have to wait until the CPU is free and can be rescheduled.
• As processes enter the system, they are put into a job queue, which consists of all processes in
the system.
• The processes that are residing in main memory and are ready and waiting to execute are kept
on a list called the ready queue .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 . The system also includes other queues. Each
device has its own device queue.
Queues for Process Scheduling




Fig 4: Queues for Process Scheduling
3

Written for

Institution
Course

Document information

Uploaded on
June 19, 2024
Number of pages
30
Written in
2023/2024
Type
Class notes
Professor(s)
Na
Contains
All classes

Subjects

$15.99
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
chinnu2

Get to know the seller

Seller avatar
chinnu2 Ptovidence
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
1 year
Number of followers
0
Documents
4
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