0% found this document useful (0 votes)
11 views3 pages

CH 3

chapter 3 good for computer science

Uploaded by

hamoabbaas123
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)
11 views3 pages

CH 3

chapter 3 good for computer science

Uploaded by

hamoabbaas123
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
You are on page 1/ 3

Ch3

• Processes : A program becomes a process when an executable file is loaded into the memory and
then becomes an active entity.

• Program : is a passive entity such as the file that contains the list of instructions stored on a disk
always referred to as an executable file.

• The fundamental task of any operating system is the process management.

• Processes include not only a text but also include a set of resources such as open files and pending
signals.

• Processes also contain internal kernel data, processor state, an address space, and a data section.

• OS must allocate resources to processes enable sharing of information, protect resources, and enable
the synchronization among processes.

• Process represents the following components:


#◦ Text section: program code itself

#◦ Stack: temporary data (function parameters, return addresses, local variables)

#◦ Data section: global variables

#◦Heap: contains memory dynamically allocated during run-time

Process Control Block (PCB)

• Process Control Block (PCB): contains information associated with each process: process state, PC,
CPU registers, scheduling information, accounting information, I/O status information

•Process identification information

Process identifier: numeric identifiers represent the unique process identifier


User identifier: the user who is responsible for the job)
• Processor state Information >Process state –running, waiting, etc

• Program counter >location of instruction to next execute

• CPU registers >contents of all process-centric registers

• CPU scheduling information >priorities, scheduling queue pointers

• Memory-management information >memory allocated to the process

• Accounting information >CPU used, clock time elapsed since start, time limits
• I/O status information >I/O devices allocated to process, list of open files
As a process executes, it changes state

• new : The process is being created

• running : Instructions are being executed

• waiting : The process is waiting for some event to occur

• ready : The process is waiting to be assigned to a processor

• terminated : The process has finished execution

Process Scheduling
• 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

• Short term scheduler (or CPU scheduler)

#◦ Selects which process should be executed next and allocates CPU.

#◦Invoked frequently (milliseconds) →(must be fast)

• Long term scheduler (or job scheduler)

#◦Selects which processes should be brought into the ready queue.

#◦Invoked infrequently (seconds, minutes) →(may be slow)

#◦Controls the degree of multiprogramming.

• Medium-term scheduler

#◦ Can be added if degree of multiple programming needs to decrease

#◦ Remove process from memory, store on disk, bring back in from disk to continue execution: swapping
• Processes within a system may be independent or cooperating

• Cooperating process can affect or be affected by otherprocesses, including sharing data.

• Cooperating processes need interprocesscommunication (IPC)

•Two models of IPC:

Shared memory

Message passing

You might also like