os211

HOME
« PREVIOUS | | NEXT »

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. This can lead to the inconsistency of shared data. So the change made by one process not necessarily reflected when other processes accessed the same shared data. To avoid this type of inconsistency of data, the processes need to be synchronized with each other.

  2. Problems in Critical Section
    The critical section is a code segment where the shared variables can be accessed. An atomic action is required in a critical section i.e. only one process can execute in its critical section at a time. All the other processes have to wait to execute in their critical sections. The critical section problem needs a solution to synchronize the different processes.

  3. How to Solve Critical Section Problems
    The critical section problem needs a solution to synchronize the different processes. The solution to the critical section problem must satisfy the following conditions
    • Mutual Exclusion Out of a group of cooperating processes, only one process can be in its critical section at a given point of time.
  1. Cooperating Processes
    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.

  2. Peterson’s Algorithm
    The producer consumer problem (or bounded buffer problem) describes two processes, the producer and the consumer, which share a common, fixed-size buffer used as a queue. Producer produce an item and put it into buffer. If buffer is already full then producer will have to wait for an empty block in buffer. Consumer consume an item from buffer. If buffer is already empty then consumer will have to wait for an item in buffer. Implement Peterson’s Algorithm for the two processes using shared memory such that there is mutual exclusion between them. The solution should have free from synchronization problems.

  3. Semaphore?
    Semaphore is defined as a variable that is non-negative and shared between threads. It is a mechanism that can be used to provide synchronization of tasks. Counting semaphore uses a count that helps task to be acquired or released numerous times. The binary semaphores are quite similar to counting semaphores, but their value is restricted to 0 and 1. Wait operation helps you to control the entry of a task into the critical section Signal semaphore operation is used to control the exit of a task from a critical section. Semaphore allows more than one thread to access the critical section. One of the biggest limitations of a semaphore is priority inversion.

  4. How Process are Identified?
    Process ID or Process Identifier is a unique number that identifies each running processes in an operating system, such as Linux, Unix, macOS, and Microsoft Windows. In Windows, we can list all tasks and associated PID by using tasklist command and ps command for Unix and Linux users. Another use of PID is to kill a process using kill command (Unix / Linux) or taskkill command (Windows)

  5. The Difference Between Semaphore and Mutex
    The basic difference between semaphore and mutex is that semaphore is a signalling mechanism i.e. processes perform wait() and signal() operation to indicate whether they are acquiring or releasing the resource, while Mutex is locking mechanism, the process has to acquire the lock on mutex object if it wants to acquire the resource. Semaphore is a better option in case there are multiple instances of resources available. In the case of single shared resource mutex is a better choice.

  6. Monitors, Semaphore V2?
    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. Deadlocks
    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.