wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

CONCURRENCY: MUTUAL EXCLUSION AND SYNCHRONIZATION-het karia

profile
HET KARIA
Jul 04, 2024
0 Likes
0 Discussions
110 Reads

CONCURRENCY: MUTUAL EXCLUSION AND SYNCHRONIZATION

Concurrency is the execution of multiple instruction sequences at the same time. It happens in the operating system when there are several process threads running in parallel. The running process threads always communicate with each other through shared memory or message passing. Concurrency results in the sharing of resources resulting in problems like deadlocks and resource starvation. 

It helps in techniques like coordinating the execution of processes, memory allocation, and execution scheduling for maximizing throughput. 

During concurrent execution of processes, processes need to enter the critical section (or the section of the program shared across processes) at times for execution. It might happen that because of the execution of multiple processes at once, the values stored in the critical section become inconsistent. In other words, the values depend on the sequence of execution of instructions – also known as a race condition. The primary task of process synchronization is to get rid of race conditions while executing the critical section.

This is primarily achieved through mutual exclusion.

 Mutual Exclusion is a property of process synchronization that states that “no two processes can exist in the critical section at any given point of time”. The term was first coined by Dijkstra. Any process synchronization technique being used must satisfy the property of mutual exclusion, without which it would not be possible to get rid of a race condition.

Mutual exclusion is only applicable when the following conditions are met :

1. When using shared resources, it is important to ensure mutual exclusion between various processes. There cannot be two processes running simultaneously in either of their critical sections.

2. It is not advisable to make assumptions about the relative speeds of the unstable processes.

3. For access to the critical section, a process that is outside of it must not obstruct another process.

4. Its critical section must be accessible by multiple processes in a finite amount of time; multiple processes should never be kept waiting in an infinite loop.

Requirements for Mutual Exclusion Any facility or capability that is to provide support for mutual exclusion should meet the following requirements:

1. Mutual exclusion must be enforced: Only one process at a time is allowed into its critical section, among all processes that have critical sections for the same resource or shared object.

2. A process that halts in its noncritical section must do so without interfering with other processes.

 3. It must not be possible for a process requiring access to a critical section to be delayed indefinitely: no deadlock or starvation.

4. When no process is in a critical section, any process that requests entry to its critical section must be permitted to enter without delay.

5. No assumptions are made about relative process speeds or number of processors.

6. A process remains inside its critical section for a finite time only

Approaches To Implementing Mutual Exclusion

  1. Software method: Leave the responsibility to the processes themselves. These methods are usually highly error-prone and carry high overheads.
  2.  Hardware method: Special-purpose machine instructions are used for accessing shared resources. This method is faster but cannot provide a complete solution. Hardware solutions cannot give guarantee the absence of deadlock and starvation.

    3. Programming language method: Provide support through the operating system or through the programming language.


Comments ()


Sign in

Read Next

The Rise of Evil Twin Attacks: A New Kind Of Spoofing Cyberattack

Blog banner

Sagar Parikrama

Blog banner

SECURITY TOOLS

Blog banner

Top 5 Tech Innovations of 2018

Blog banner

Memory heirachy (Operating system)

Blog banner

Finding Meaning, and Identity : Understanding Existential Concerns and Mental Well-being

Blog banner

Information of meesho company

Blog banner

Network Forensics Tools and Techniques

Blog banner

Data-Driven Prediction of Virtual Item Prices in Online Games

Blog banner

Security Breaches in Stock market trading

Blog banner

Virtual Memory

Blog banner

Virtual Memory

Blog banner

Personalised Name Labels vs. Handwritten Stickers: Which Is Better for Your Child’s School Essentials?

Blog banner

objectives and function of operating system

Blog banner

What if COVID does not exist!

Blog banner

Pioneer Park Zolfo Springs — A Hidden Gem for Nature Lovers Near Arcadia

Blog banner

Multiple-Processor Scheduling in Operating System

Blog banner

Kernel Memory Allocation In Linux.

Blog banner

Why White Bedding Has Become a Hotel Industry Standard?

Blog banner

10 Things To Do On Valentine's Day If You're Single

Blog banner

Paddling the Peace River: The Ultimate Guide to Kayaking and Canoeing Near Arcadia

Blog banner

Mango Raisin Chutney (sweet mango raisin spread)

Blog banner

Firewall

Blog banner

Things You Should Leave Behind In 2025, Whilst In 2026

Blog banner

Service Strategy principles

Blog banner

Python as a tool for Data science task & project

Blog banner

Computer Forensics and its Impact in Business Environment

Blog banner

Types of Viruses

Blog banner

Confidence Building Activities for the New School Year

Blog banner

Career v/s Job : Choose your passion

Blog banner

Threading

Blog banner

RAID - LEVELS OF RAID

Blog banner

Data Visualization – Importance and tools (Tableau, Power BI)

Blog banner

Consumer to consumer Business model

Blog banner

Lifestyle of a photographer

Blog banner

Deadlock

Blog banner

Os assignment

Blog banner

Why Does Hierarchy Still matter in Organizations?

Blog banner

Uniprocessor scheduling

Blog banner

Starvation

Blog banner

What is OS and its overview

Blog banner

Cloud Computing: Threats and Vulnerabilities

Blog banner