os202

A repository for operating systems class fall 2020

View on GitHub

HOME


Top 10 List of Week 07

  1. Synchronization
    There are two types of processes: Independent and Cooperative. The link give above lists down the difference between them. Process synchronization problem arises in the case of Cooperative process because resources are shared in Cooperative processes. Thus, it is prone to issues involving the integrity of data shared by several processes.

  2. Race condition
    A race condition occurs when processes have concurrent access to shared data and the final result depends on the particular order in which concurrent accesses occur. Race conditions can result in corrupted values of shared data. A race condition is a situation that may occur inside a critical section which will be explained below. The top answer in the thread above gives a clear example.

  3. Critical-Section Problem
    The video above illustrates about the critical region in synchronization with real time example. In a nutshell, it is a piece of code in which processes or threads access a shared resource which potentially causes race. Thus, critical section contains shared variables which need to be synchronized to maintain consistency of data variables. A solution to the critical-section problem must satisfy the following three requirements: (1) mutual exclusion, (2) progress, and (3) bounded waiting.

  4. Peterson’s Solution
    Peterson’s solution is restricted to two processes that alternate execution between their critical sections and remainder sections. Peterson’s solution requires the two processes to share two data items. See the algoritm in the link. It uses two variables, flag and turn. A flag[n] value of true indicates that the process n wants to enter the critical section. Entrance to the critical section is granted for process P0 if P1 does not want to enter its critical section or if P1 has given priority to P0 by setting turn to 0.

  5. Mutex Lock
    The link shows an intuitive illustration on this. In essence, it is a program object that prevents simultaneous access to a shared resource. It provides mutual exclusion by requiring that a process acquire a lock before entering a critical section and release the lock on exiting the critical section.

  6. Semaphores
    is a technique to manage concurrent processes by using a simple integer value, which is known as a semaphore. A semaphore is like a security guard who tracks open seats at a restaurant. He lets in customers to the restaurant only if the seats are available. If the seats are occupied, the customers (processes) will have to wait outside the restaurant. Credits to the cool video attached.

  7. Mutex vs Semaphore
    It might have come across that a mutex is binary semaphore, isn’t it? The g&g article in the link above clarifies this particular matter. It explains what differ the despite the similarity in the implementation.

  8. Deadlock
    Solutions to the critical-section problem may suffer from liveness problems, including deadlock. Deadlock is a situation where a set of processes are blocked because each process is holding a resource and waiting for another resource acquired by some other process. See the graph representation in the above link.

  9. Methods for handling deadlock
    Deadlock arises when these four conditions occur: Mutual Exclusion, Hold and Wait, No Preemption, Circular Wait (See the link for each detail). There are three ways to handle deadlock which is the link above, namely deadlock prevention or avoidance, Deadlock detection and recovery, and Ignore the problem altogether. The link also explains in a clear and concise way.

  10. Inter Process Communication
    How processes communicate with each other is explained wonderfully by the neso academy. IPC mechanism allows processes to exchange data and information with two models: shared memory or message passing. What are them, really? The video will get your back. Well, at least mine.