What is Process Synchronization?

How does Process Synchronization work?

Sections of a Program

  • Entry Section: It is part of the process which decides the entry of a particular process.
  • Critical Section: This part allows one process to enter and modify the shared variable.
  • Exit Section: The exit section allows the other process that is waiting in the Entry Section, to enter into the Critical Sections. It also checks that a process that finished its execution should be removed through this Section.
  • Remainder Section: All other parts of the Code, which is not in the Critical, Entry, and Exit Section, are known as the Remainder Section.

Critical Section Problem

  • The entry to the critical section is handled by the wait() function, and it is represented as P().
  • The exit from a critical section is controlled by the signal() function, represented as V().

Rules for Critical Section

  • Mutual Exclusion: If a process P is executing in its critical section then no other process can be executing in their critical sections
  • Progress: If no process is executing in its critical section and some process wishes to enter their critical section then only those process that is not executing in their remainder sections can participate in deciding which process will enter its critical section next and this selection cannot be done indefinitely.
  • Bound Waiting: There exists a bound or a limit on the number of times other processes are to enter their critical sections after a process has made a request to enter its critical section and before that request is granted.

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Use your Cerebral

Characteristics of Good Test Case!!!!

Laravel Model Multiple languages’ Attributes

5 Design Patterns Every Engineer Must Know

Real time Invisible cloak

Setup a Site to Site IPsec VPN With Strongswan & Meraki MX (IKEv1)

Dynamic Programming: From Zero to Hero

TryHackMe : Pickle Rick Walkthrough

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adith - The Data Guy

Adith - The Data Guy

More from Medium

Encoding technique

Sins of omission?

Normality Test

Pain — Positive Perspective