You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Turnaround Time = Completion Time - Arrival Time
Waiting Time = Turnaround Time - Burst Time
Response Time = First Run Time - Arrival Time
Average Waiting Time = Sum(Waiting Times) / Number of Processes
Synchronization
Semaphore Operations
wait(S) { // P() or down()while (S <= 0)
; // busy waitS--;
}
signal(S) { // V() or up()S++;
}
Critical Section Requirements
Mutual Exclusion: Only one process in CS at a time
Progress: Decision cannot be postponed indefinitely
Bounded Waiting: Limit on times others enter before a waiting process
Classic Problems
Producer-Consumer: Use semaphores (full, empty, mutex)
Hold and Wait: Hold resources while waiting for more
No Preemption: Resources cannot be forcibly taken
Circular Wait: Circular chain of waiting processes
Banker's Algorithm
Available[m] // Available resource instances
Max[n][m] // Maximum demand
Allocation[n][m] // Currently allocated
Need[n][m] // Max - Allocation
Safety check: Find sequence where all processes can finish
Memory Management
Paging
Page Size = 2^offset_bits
Number of Pages = Address Space / Page Size
Page Table Size = Number of Pages × Entry Size
Physical Address = (Frame Number × Page Size) + Page Offset