Introduction of Process Synchronization _ GeeksforGeeks
Introduction of Process Synchronization _ GeeksforGeeks
Search... 99+
Process Synchronization
Process Synchronization is the coordination of execution of multiple
processes in a multi-process system to ensure that they access shared
resources in a controlled and predictable manner. It aims to resolve the
https://www.geeksforgeeks.org/introduction-of-process-synchronization/ 1/12
06/06/2025, 08:37 Introduction of Process Synchronization | GeeksforGeeks
https://www.geeksforgeeks.org/introduction-of-process-synchronization/ 2/12
06/06/2025, 08:37 Introduction of Process Synchronization | GeeksforGeeks
Example:
Let consider a Linux code:
>>ps/grep "chrome"/wc
Therefore, three processes are created which are ps, grep and wc. grep
takes input from ps and wc takes input from grep.
https://www.geeksforgeeks.org/introduction-of-process-synchronization/ 3/12
06/06/2025, 08:37 Introduction of Process Synchronization | GeeksforGeeks
We can not notice that the different segments of two processes running
in different order would give different values of balance.
https://www.geeksforgeeks.org/introduction-of-process-synchronization/ 4/12
06/06/2025, 08:37 Introduction of Process Synchronization | GeeksforGeeks
In the entry section, the process requests for entry in the Critical
Section.
https://www.geeksforgeeks.org/introduction-of-process-synchronization/ 5/12
06/06/2025, 08:37 Introduction of Process Synchronization | GeeksforGeeks
The challenge arises because both the producer and the consumer need
to access the same buffer at the same time, and if they do not properly
synchronize their actions, issues can occur.
1. Buffer Overflow: If the producer tries to add data when the buffer is
full, there will be no space for new data, causing the producer to be
blocked.
2. Buffer Underflow: If the consumer tries to consume data when the
buffer is empty, it has nothing to consume, causing the consumer to
be blocked.
Readers-Writers Problem
https://www.geeksforgeeks.org/introduction-of-process-synchronization/ 6/12
06/06/2025, 08:37 Introduction of Process Synchronization | GeeksforGeeks
Readers: These processes only read data from the shared resource
and do not modify it.
Writers: These processes modify or write data to the shared
resource.
Problem Setup:
https://www.geeksforgeeks.org/introduction-of-process-synchronization/ 7/12
06/06/2025, 08:37 Introduction of Process Synchronization | GeeksforGeeks
Conclusion
Concurrent computing requires process synchronization to coordinate
numerous processes in a multi-process system to regulate and forecast
resource access. It addresses race situations and data inconsistency,
essential for data integrity. Semaphores and Peterson's solution are
used for synchronization. Synchronization is necessary for data
consistency but adds complexity and performance overheads, making
correct implementation and management vital for multi-process
systems.
https://www.geeksforgeeks.org/introduction-of-process-synchronization/ 8/12
06/06/2025, 08:37 Introduction of Process Synchronization | GeeksforGeeks
Similar Reads
Monitors in Process Synchronization
Monitors are a higher-level synchronization construct that simplifies
process synchronization by providing a high-level abstraction for data…
Process Synchronization
On the basis of synchronization, processes are categorized as one of the
following two types: Independent Process : Execution of one process do…
https://www.geeksforgeeks.org/introduction-of-process-synchronization/ 9/12
06/06/2025, 08:37 Introduction of Process Synchronization | GeeksforGeeks
12 min read
Registered Address:
K 061, Tower K, Gulshan Vivante
Apartment, Sector 137, Noida, Gautam
Buddh Nagar, Uttar Pradesh, 201305
https://www.geeksforgeeks.org/introduction-of-process-synchronization/ 10/12
06/06/2025, 08:37 Introduction of Process Synchronization | GeeksforGeeks
Advertise with us
Company Explore
About Us Job-A-Thon
Legal Offline Classroom Program
Privacy Policy DSA in JAVA/C++
Careers Master System Design
In Media Master CP
Contact Us Videos
Corporate Solution
Campus Training Program
Tutorials DSA
Python Data Structures
Java Algorithms
C++ DSA for Beginners
PHP Basic DSA Problems
GoLang DSA Roadmap
SQL DSA Interview Questions
R Language Competitive Programming
Android
https://www.geeksforgeeks.org/introduction-of-process-synchronization/ 12/12