Title: FIGURE 4
1CIS 630 OPERATING SYSTEMS
CHAPTER 4 Morty Kwestel 2003
2CHAPTER 4
- Kernel
- Queues
- Resources
- Implementation
- Threads
- Implementation
3CHAPTER 4
- Processes
- Descriptors
- Operations
- Synchronization
- Semaphores
- Monitors
- Clocks
4CHAPTER 4
- Communication
- Message passing
- Interrupts
5FIGURE 4-1
? O/S Process for Login
?Parent
?Child
?Grandchild
Process Creation hierarchy
6FIGURE 4-3(a)
Priority Queue
7FIGURE 4-3(b c)
8FIGURE 4-4
Threads within a Process
9FIGURE 4-5
Structure of PCB
10FIGURE 4-6
Process Status changes
11Request
Request(resource) if (Free(resource)) Allo
cate(resource, self) else Block(self,
resource) Scheduler()
12Release
Release(resource) Deallocate(resource,
self) if(process_blocked_on(resource,
process)) Allocate(resource, process)
Unblock((process, resource)
Scheduler()
13Test Set
TS(R, X) R X // TEST R holds previous
value of X. X 0 // SET value of X is
always reset to 0. R is a CPU Register. X
is a location in Memory that will hold a Boolean
value.
14Semaphore
wait(s) signal(s) if (s 1)
s s 0 else busy wait
15Semaphore / TS
wait(s) do TS(R, s) while (!R) // busy
wait if R 0. signal(s)s 1
//where s X.
16Monitor
wait(mutex) //body of procedure if(urgen
t_count) signal(urgent) else signal(mutex
)
17Wait Condition
cond_count if (urgent_count)
signal(urgent) else signal(mutex) wait(cond
_X) cond_count--
18Signal Condition
if (cond_count) urgent_count
signal(cond_X) wait(urgent)
urgent_count--
19Timer
int delay_sem 0 Â Delay(tdel) Set_T
imer(tdel) wait(delay_sem) Time-Out()
signal(delay_sem)
20Functions
tn Create_LTimer() Â Destroy_Timer(tn)
Set_Timer(tn, tdel)
21FIGURE 4-8
?Priority based
Insert
Timer Queue Absolute differences
22Set Timer
Set_Ltimer(tn, tdel) wnew Get_Time()
tdel wold head(TQ)-gtwakeup if (wnew
lt wold) Set_Timer(tdel)
insert(TQ, (p, tn, wnew))
23FIGURE 4-9
Timer Queue Relative difference
24FIGURE 4-10a
m holds address of buffer
Send/Receive buffers Copying
25FIGURE 4-10b
Send/Receive buffers Copying
26FIGURE 4-10c
Send/Receive buffers Copying
27FIGURE 4-11a
Basic interrupt
28FIGURE 4-11b
Monitor interrupt