Week 5#
There was a one-week break between weeks 4 and 5, so I didn't post anything last week.
C12#
Synchronization means ensuring that only one process accesses a specific resource at a time, or that processes execute in the correct order.
Shared resources are resources used in common — they can be global variables, files, I/O devices, or secondary storage.
Critical section refers to a code region that accesses shared resources where problems occur if executed simultaneously. If a process is in the critical section, other processes must wait outside of it.
Mutual exclusion is the control mechanism that prevents other processes from entering the critical section while one process is already working in it.
Mutex lock achieves mutual exclusion between processes by locking the critical section.
Semaphore is a synchronization tool that can solve critical section problems even when there are multiple shared resources.
Monitor is a synchronization tool that is more user-friendly compared to semaphores, using condition variables.
C13#
Deadlock refers to the phenomenon of waiting indefinitely for an event that will never occur.
The Dining Philosophers Problem is an example that demonstrates the occurrence of deadlock.
Resource allocation graphs can be used to represent deadlock.
Deadlock conditions are mutual exclusion, hold and wait, no preemption, and circular wait.
Deadlock prevention is a method that prevents one of the deadlock conditions from being satisfied.
Deadlock avoidance is a method that allocates resources only when it is possible to maintain a safe state.
Deadlock detection and recovery is an approach that periodically checks for deadlock occurrence and recovers whenever deadlock is detected.
Homework#
p. 363, Review Question 1 (Required)#

Answer: #4
Summarizing Critical Section and Mutual Exclusion Concepts (Optional)#
Ch.12 (12-1) Summarize the concepts of critical section and mutual exclusion.
A critical section is a code region that accesses shared resources where running two or more processes simultaneously causes problems.
Mutual exclusion is an algorithm used to avoid simultaneous use of non-shareable resources. If one process has entered the critical section, no other process can enter it.
Experience is simply the name we give our mistakes.
— Oscar Wilde