Академический Документы
Профессиональный Документы
Культура Документы
Lecture Series By :
Er. Kanwalvir Singh Dhindsa
Website ::
www.dhindsa.info
http://groups.google.com/group/os-2007
1
O.S. by Er. K.S.Dhindsa © 2007
Process Concept
2
O.S. by Er. K.S.Dhindsa © 2007
Process State
3
O.S. by Er. K.S.Dhindsa © 2007
Diagram of Process State
4
O.S. by Er. K.S.Dhindsa © 2007
Processes
• “A program in execution”
• Modern computers allow several at once
– “pseudoparallelism”
A A B C
A
Program B
B
Counter
Conceptual View C
C Time
5
O.S. by Er. K.S.Dhindsa © 2007
Unix Process Creation
6
O.S. by Er. K.S.Dhindsa © 2007
Process Scheduler
Scheduler
7
O.S. by Er. K.S.Dhindsa © 2007
Process Control Block
8
O.S. by Er. K.S.Dhindsa © 2007
Process Control Block (PCB)
9
O.S. by Er. K.S.Dhindsa © 2007
Process Control Block (PCB)
10
O.S. by Er. K.S.Dhindsa © 2007
CPU Switch From Process to Process
11
O.S. by Er. K.S.Dhindsa © 2007
Process Scheduling Queues
12
O.S. by Er. K.S.Dhindsa © 2007
QUEUEING DIAGRAM --Representation of Process Scheduling
RESOURCES
Flow of processes
Device
queues
13
O.S. by Er. K.S.Dhindsa © 2007
SCHEDULERS
• Long-term scheduler (or job scheduler) – selects
which processes should be brought into the ready
queue
MTS ???
15
O.S. by Er. K.S.Dhindsa © 2007
Schedulers (Cont.)
• Processes can be described as either:
16
O.S. by Er. K.S.Dhindsa © 2007
Context Switch
• When CPU switches to another process, the
system must save the state of the old
process and load the saved state for the new
process(occurs fast in microseconds)
19
O.S. by Er. K.S.Dhindsa © 2007
Buffering
• Queue of messages attached to the link;
implemented in one of three ways
1.Zero capacity – 0 messages
Sender must wait for receiver (rendezvous)
2.Bounded capacity – finite length of n
messages
Sender must wait if link full
3.Unbounded capacity – infinite length
Sender never waits
20
O.S. by Er. K.S.Dhindsa © 2007
Client-Server Communication
• Sockets
21
O.S. by Er. K.S.Dhindsa © 2007
Sockets
22
O.S. by Er. K.S.Dhindsa © 2007
Socket Communication
23
O.S. by Er. K.S.Dhindsa © 2007
Remote Procedure Calls ????
• Remote procedure call (RPC) abstracts
procedure calls between processes on
networked systems
• Stubs – client-side proxy for the actual
procedure on the server
• The client-side stub locates the server and
marshalls the parameters.
• The server-side stub receives this message,
unpacks the marshalled parameters, and
peforms the procedure on the server.
24
O.S. by Er. K.S.Dhindsa © 2007
Threads
“Multithreaded Program”
• Basic unit of CPU utilization Process
• Also called Lightweight Processes (LWP) text segment
• Consists of : A B C
Program
– program counter
Counter
– register set
– stack space (Threads)
• Shares :
A stack
B stack
C stack
– code section
– data section TASKS
– OS resources A B C
(open files& signals)
data segment
25
O.S. by Er. K.S.Dhindsa © 2007
Thread Features :
Threads can be in any of the states:
ready,blocked,running or terminated
Like Processes,
Threads share CPU,and only one thread at a time is active
Thread Benefits ??
26
O.S. by Er. K.S.Dhindsa © 2007
Threads Standards
• POSIX (Pthreads)
– Common API
– Almost all Unix’s have thread library
• Solaris
– started before POSIX standard
– likely to be same as POSIX
27
O.S. by Er. K.S.Dhindsa © 2007
Levels of Threads
Kernel Thread
28
O.S. by Er. K.S.Dhindsa © 2007
PROCESSES
Lecture Series By :
Er. Kanwalvir Singh Dhindsa
Website ::
www.dhindsa.info
http://groups.google.com/group/os-2007
29
O.S. by Er. K.S.Dhindsa © 2007