Top 10 List of Week 07
Muhammad Zahran Agung Dewantoro

Top 10 List of Week 07

  1. Process Synchronization
    Process Synchronization is the task of coordinating the execution of processes in a way that no two processes can have access to the same shared data and resources. It is specially needed in a multi-process system when multiple processes are running together, and more than one processes try to gain access to the same shared resource or data at the same time.

  2. Cooperating Process
    A cooperating process is one that can affect or be affected by other processes running on the system. Cooperating processes can either directly share a logical address space or be allowed to share data only through shared memory or message passing.

  3. Race Conditition
    A situation where several processes access and manipulate the same data concurrently, but because of the nature of the device or system, the operations must be done in the proper sequence to be done correctly.

  4. Critical Section
    Critical section is a code where it can be accessed by multiple processes. Critical section contains shared variables or resources which are needed to be synchronized to maintain consistency of data variable.

  5. Semaphore
    Semaphores are integer variables that are used to solve the critical section problem by using two atomic operations, wait and signal that are used for process synchronization.
    • Wait
      The wait operation decrements the value of its argument S, if it is positive. If S is negative or zero, then no operation is performed.
    • Signal
      The signal operation increments the value of its argument S.
  6. Monitors
    Monitors are a synchronization construct that were created to overcome the problems caused by semaphores such as timing errors. Monitors are abstract data types and contain shared data variables and procedures. The shared data variables cannot be directly accessed by a process and procedures are required to allow a single process to access the shared data variables at a time.

  7. Deadlock
    Deadlock is a situation that occurs in OS when any process enters a waiting state because another waiting process is holding the demanded resource. Deadlock is a common problem in multi-processing where several processes share a specific type of mutually exclusive resource known as a soft lock or software.

  8. Deadlock prevention
    Deadlocks can be prevented by eliminating at least one of the four conditions
    • Mutual Exclusion: One or more than one resource are non-shareable (Only one process can use at a time)
    • Hold and Wait: A process is holding at least one resource and waiting for resources.
    • No Preemption: A resource cannot be taken from a process unless the process releases the resource.
    • Circular Wait: A set of processes are waiting for each other in circular form.
  9. Deadlock Avoidance
    Deadlock avoidence is to prevent deadlock happening by preventing the deadlock condition. This requires more information for each processes and leads to low device utilization. Several ways to avoid deadlock:
    • Safe state. The system can allocate resources to each thread without entering deadlock state.
    • Resource-Allocation graph algorithm. If we have a resource-allocation system with only one instance of each resource type, we can use a variant of the resource-allocation graph.
  10. Deadlock Recovery
    There are two ways to recover from deadlock:
    • Process and Thread Termination. We can kill one or more processes. There are two methods. The first one is to abort all deadlocked processes. The second one is to abort one process at a time until the deadlock is eliminated.
    • Resource preemption. Preempt some resources from a process, then give those resources to other processes.

© Muhammad Zahran Agung Dewantoro, 2021-2021