Question
Operating Systems Questions 1. The bakery algorithm allows two processes to pick the same value for turn. Yet, it does not create a conflict for
Operating Systems Questions
1. The bakery algorithm allows two processes to pick the same value for turn. Yet, it does not create a conflict for mutual exclusion. How is this situation resolved?
2. Consider the three states a process can assume: running, ready, and blocked. A process is currently scheduled to run. There is a hardware interrupt raised. What will be the state transition for the process?
3. The the following code to creates a child to do something and return. The return value is to be caught by the parent. Can you see any problem with the code that I wrote? How will you fix it?
pid_t pid = fork();
if ( pid < 0 )
exit ( 1 );
if ( pid == 0 )
wait();
exit ( 0 );
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started