Professional Documents
Culture Documents
Process
Process
Web Server
Pseudoparallelism: Multiprogramming
Printing Backup
File Photos Pseudoparallelism:
One CPU switches from process to process quickly,
running each for tens or hundreds of milliseconds.
Web Playing
Surfing Music
Incoming
Antivirus
Email
PC
booted
Process Model
All runnable software are organized into sequential processes
Process (An instance of executing program including current values of program counter, registers
and variables)
Computer
Multiprogrammin
g four programs
in Memory
مثال
مثال یو نفر دي چه یو کیک پخوي نو دی د کیک ریسفي او اشپزخانه لري چه پکښی ټول سامان د کیک پخولو
لکه شیدی هګی بوره موجود دي چه کیک ریسفی د یو پروګرام مثال لري چه د کیک پخولو یوه طریقه الګوریتم
پکښی ذکرشوی او نفر د پروسیسر مثال لري چه ترسره کوونکی یا پخوونکي د ریسفي دي او مواد د کیک د ډیټا
مثال لري او د ریسفي ویل ،مواد سره ګډول عبارت د پروسیس څخه دي اوس فرضآ د دهغه نفر بل کوچنی زوی
په ژړه راځغلي او نعری وهي چه غالبوزي وخوړلم نو نفر هغه ریسفي پر هغه ځاي پریږدي او طبی مواد راخلي
د زوي د زخم کار ورکوي چه دلته یو پروسیس یا کار پریږدی او بل شروع کوي چه اهمیت یی زیات وي چه د
زوي د زخم کار خالص سو بیرته خپل اول کار شروع او خالصوي
اساسی مفاهیم:
پروسیس یو جریان دی چه انفوټ ،اوټفوټ اویو حالت لري.
یو پروسیسر کوالي سو په مختلفو scheduling algorithmsسره مختلف پروسیسو باندي په مختلف اندازو سره کار وکړي
او یو پروګرام هغه دي چه په ډیسک کی ثبتیږي او کوم خاص څه سرته نه رسوي
يو پروګرام چه دوه ځلي روان سی نو دوه پروسیس ځنی جوړیزي لکه مایکروسافټ ورډ
PROCESS CREATION
Fork System Call:- creates exact clone of existing process after fork called both parent and
child have same memory image, same environment strings and same open files usually child
process then executes EXECVE system call or similar system to change memory image and
run new program
sort command to shell shell forks off child process
i.e.
and child executes sort(reason to manipulate its file descriptor
after FORK before EXEVE to accomplish Standard IN,OUT, ERR)
Window CreateProcess Call
In Windows Win32 Function Call ( CREATEPROCESS ) : Handles both process creation and loading
correct program into new process
CREATEPROCESS has around 10 Parameters
Program to be executed
Various security attributes
Bit for open files info
Priority information
Specification for window to be created for process
Pointer to a structure of information to be returned to caller
Win32 has about 100 functions like CP to manage synchronize Process
AFTER PROCESS CREATION
After Process creation both Parent and child have their distinct Address Space
no writable memory shared
Some Unix Implementation share program text between but can’t be modified
and child may share parent’s memory but memory is shared copy-on-write
(that chuck of memory is copied first to private area then edited) No writable
memory is shared
Windows Parent and child Address Space are different from Start
PROCES TERMINATION
All created processes run and does the job the required eventually terminates
due to one of following conditions:
1. Normal Exit ( Voluntary )
Such X button in Graphical window or Exit System Call
When a process creates another process, parent and child process are associated to each other
In Unix a process and all its children or descendants together form a process group when a user
sends a signal from keyboard the signal is delivered to all members of associated group
Such as when Unix is booted “init” process is started from boot image and starts running and read how
many terminals are there and accordingly forks off new process per terminal and login process is started
as that accepted then it starts shell script to accept commands
In Contrast windows has no Process Hierarchy rather it has special token called Handle which has
control of Child process but it can be passed to another Process thus invalidating Process
Hierarchy
Process States
3. Blocked State
Unable to run until some external event happens
NOTE:-