Critical Section in Synchronization

Updated

Process Synchronization is a way to coordinate processes that use shared data.

Critical section is a segment of code that can be accessed by only one signal process at a certain instance in time. This section consists of shared data resources that need to be accessed by other processes. The entry to the critical section is handled by the wait() function, represented as P(). The exit from a critical section is controlled by the signal() function, represented as V(). Only one process can be executed inside the critical section at a time. Other processes waiting to execute their critical sections have to wait until the current process finishes executing its critical section.

This protected section is the critical section or critical region. It cannot be executed by more than one process at a time.

Solution to Critical Section Problem :
Any solution to the critical section problem must satisfy three requirements:

  • Mutual Exclusion –
    Only one process can be in its critical section at a given point of time.

  • Progress –
    If no process is in its critical section, and if one or more threads want to execute their critical section then any one of these threads must be allowed to get into its critical section.

  • Bounded Waiting –
    Bounded waiting means that each process must have a limited waiting time. It should not wait endlessly to access the critical section.


  • Please write comments if you find anything incorrect. A gentle request to share this topic on your social media profile.

Comment
Next tutorial
CPP_Programmer Published 10 Sep 2020 · 2 min read

Related tutorials

  • Software concepts of Computer

    Before starting the software concepts, let us take a brief look into the components of computer. Components of Computer: A computer system has 3 components namely: Hardware, Software,…

    3 min read
  • Difference between Full Virtualization and Para-virtualization

    Process of abstracting underlying hardware components from software is the primary concept behind virtualization. 1. Full Virtualization In full virtualization, a single host operating system allows the execution…

    2 min read
  • Storage Structure memory

    Storage structure consists of registers, main memory, and magnetic disk is only one of many possible storage systems. There are also cache CD ROM, magnetic takes, and so…

    3 min read
  • What is Software and its Types ?

    Software is nothing but a program or collection of programs that perform a specific task. Software is a bridge between user and computer hardware. Softwares directs the peripheral…

    1 min read
  • Searching in parent and printing result in child processes using fork()

    In C/C++, the fork() function is used to generate a new process known as the child process. We can do searching within a fork() process. Problem statement –…

    3 min read
  • Multilevel Paging in Operating System

    A page table is a data structure used by virtual memory system in a computer operating system to store the mapping between the virtual addresses and physical addresses.…

    4 min read