Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Which of the following is/are true about Pete... Start Learning for Free
Which of the following is/are true about Peterson's synchronization mechanism?
  • a)
     Progress is guaranteed
  • b)
     Busy waiting solution
  • c)
     Uses semaphore variable
  • d)
     Mutual exclusion is guaranteed
Correct answer is option 'A,B,D'. Can you explain this answer?
Most Upvoted Answer
Which of the following is/are true about Petersons synchronization mec...
Introduction

Peterson's synchronization mechanism is a classic algorithm used to provide mutual exclusion in concurrent programming. It was proposed by Gary L. Peterson in 1981 and is widely used in operating systems and parallel computing.

A. Progress is guaranteed

Progress is guaranteed in Peterson's synchronization mechanism. This means that if a process is trying to enter the critical section, it will eventually be able to do so. This guarantee is achieved through the use of the turn variable, which ensures that processes take turns entering the critical section. The turn variable is updated in a specific order, allowing each process to have a fair chance of entering the critical section.

B. Busy waiting solution

Peterson's synchronization mechanism is a busy waiting solution. Busy waiting refers to the technique where a process repeatedly checks for a condition to become true in a loop. In Peterson's algorithm, processes spin in a loop while waiting for their turn to enter the critical section. This can lead to high CPU utilization, as the process keeps executing instructions in the loop without any productive work. However, busy waiting ensures that the process can immediately enter the critical section once it is their turn.

C. Uses semaphore variable

Peterson's synchronization mechanism does not use semaphore variables. Instead, it relies on two shared variables: turn and flag. The turn variable determines which process gets to enter the critical section, while the flag variable indicates if a process is ready to enter the critical section or not. The absence of semaphore variables simplifies the implementation of Peterson's algorithm.

D. Mutual exclusion is guaranteed

Mutual exclusion is guaranteed in Peterson's synchronization mechanism. Mutual exclusion means that only one process can be in the critical section at a time. Peterson's algorithm achieves this by using the turn variable and the flag variable. The turn variable ensures that processes take turns entering the critical section, while the flag variable is used to indicate if a process is ready to enter or not. By properly updating these variables, Peterson's algorithm guarantees that only one process can be in the critical section at a time.

Conclusion

In summary, Peterson's synchronization mechanism guarantees progress, provides a busy waiting solution, and ensures mutual exclusion. It achieves these properties through the use of shared variables, specifically the turn and flag variables. While busy waiting can lead to high CPU utilization, Peterson's algorithm is a simple and effective solution for providing mutual exclusion in concurrent programming.
Free Test
Community Answer
Which of the following is/are true about Petersons synchronization mec...
Peterson's algorithm (or Peterson's solution) is a concurrent programming algorithm for mutual exclusion that allows two or more processes to share a single-use resource without conflict, using only shared memory for communication. It was formulated by Gary L. Peterson in 1981. While Peterson's original formulation worked with only two processes, the algorithm can be generalized for more than two.
Peterson's synchronization mechanism:
  • It is a busy waiting solution.
  • Mutual exclusion and progress are guaranteed.
  • It doesn't use semaphore variable, but it uses to integer variables (turn and interest) to achieve synchronization.
Hence, the correct options are (A), (B) and (D).
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Which of the following is/are true about Petersons synchronization mechanism?a)Progress is guaranteedb)Busy waiting solutionc)Uses semaphore variabled)Mutual exclusion is guaranteedCorrect answer is option 'A,B,D'. Can you explain this answer?
Question Description
Which of the following is/are true about Petersons synchronization mechanism?a)Progress is guaranteedb)Busy waiting solutionc)Uses semaphore variabled)Mutual exclusion is guaranteedCorrect answer is option 'A,B,D'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Which of the following is/are true about Petersons synchronization mechanism?a)Progress is guaranteedb)Busy waiting solutionc)Uses semaphore variabled)Mutual exclusion is guaranteedCorrect answer is option 'A,B,D'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Which of the following is/are true about Petersons synchronization mechanism?a)Progress is guaranteedb)Busy waiting solutionc)Uses semaphore variabled)Mutual exclusion is guaranteedCorrect answer is option 'A,B,D'. Can you explain this answer?.
Solutions for Which of the following is/are true about Petersons synchronization mechanism?a)Progress is guaranteedb)Busy waiting solutionc)Uses semaphore variabled)Mutual exclusion is guaranteedCorrect answer is option 'A,B,D'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of Which of the following is/are true about Petersons synchronization mechanism?a)Progress is guaranteedb)Busy waiting solutionc)Uses semaphore variabled)Mutual exclusion is guaranteedCorrect answer is option 'A,B,D'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Which of the following is/are true about Petersons synchronization mechanism?a)Progress is guaranteedb)Busy waiting solutionc)Uses semaphore variabled)Mutual exclusion is guaranteedCorrect answer is option 'A,B,D'. Can you explain this answer?, a detailed solution for Which of the following is/are true about Petersons synchronization mechanism?a)Progress is guaranteedb)Busy waiting solutionc)Uses semaphore variabled)Mutual exclusion is guaranteedCorrect answer is option 'A,B,D'. Can you explain this answer? has been provided alongside types of Which of the following is/are true about Petersons synchronization mechanism?a)Progress is guaranteedb)Busy waiting solutionc)Uses semaphore variabled)Mutual exclusion is guaranteedCorrect answer is option 'A,B,D'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Which of the following is/are true about Petersons synchronization mechanism?a)Progress is guaranteedb)Busy waiting solutionc)Uses semaphore variabled)Mutual exclusion is guaranteedCorrect answer is option 'A,B,D'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev