Discussion
What is the main disadvantage of Peterson's solution for mutual exclusion ?
Answer: B
The main disadvantage is that it fails on modern multi-core CPUs.
Peterson's algorithm for two processes uses a flag array and a turn variable, and in theory it guarantees mutual exclusion, progress and bounded waiting. But the proof assumes that every read and write to memory happens in program order and is seen at once by the other processor. Modern multi-core CPUs and compilers reorder memory operations and buffer stores, so both processes can see the other's flag as false and enter the critical section together. It works on such machines only with explicit memory barriers, which is why real systems use atomic hardware instructions instead.
Option A is false: ensuring progress is one of the algorithm's proven properties. External fragmentation is a memory-allocation problem, and high memory access time is not its characteristic weakness.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development