Question

In: Computer Science

1. Find out what a race condition is, and explain in your own words what goes...

1. Find out what a race condition is, and explain in your own words what goes wrong.

Solutions

Expert Solution

As you can see in the example i assume here b=1 and c=2 as a resouces and there are two prcoesses P1 and P2 and each of this process will execute states in given manner.

p1 will execute stat1() first and then execute state2()
p2 will execute stat2() first and then execute state1()

we assume that process p1 execute first to check what output comes

p1
****
state1() = b=2+1 = 3 so b=3 // value of b is now updated
state2() = c=3+2 = 5 so c=5

p2
****
state2() = c=1+2 = 3 so c=3 // value of c is now updated
state1() = b=1+3 = 4 so b=4

as you can compare if any process whose execution turn is at 2nd position and it execute 1st the output will be changed.

if you have any doubt then please ask me without any hesitation in the comment section below , if you like my answer then please thumbs up for the answer , before giving thumbs down please discuss the question it may possible that we may understand the question different way and we can edit and change the answers if you argue, thanks :)


Related Solutions

Q1. Explain what a race condition is. Provide an explanation of how a race condition occurs,...
Q1. Explain what a race condition is. Provide an explanation of how a race condition occurs, and what mechanisms operating systems employ to prevent them. Q2. True or False: Multi-level feedback queue scheduling can be used to favor shorter processes without knowing estimated CPU burst times in advance.
Use your own words to explain the following terminologies. 1. Crowing-out effect                             &
Use your own words to explain the following terminologies. 1. Crowing-out effect                                                                                                                  2. Stagflation                                                                                                                                3. Expansionary fiscal policy 4. Money neutrality
Why does a race condition occur? What is the solution for the race condition?
Why does a race condition occur? What is the solution for the race condition?
Explain in your own words the steps the Federal Reserve goes through when conducting a contractionary...
Explain in your own words the steps the Federal Reserve goes through when conducting a contractionary open market operation. When and why might the Federal Reserve do this? 300 words
In your own words, explain what an outlier is.
In your own words, explain what an outlier is.
What is a race condition in software?
What is a race condition in software?
1. In your own words explain what a Monad is and why it is important in...
1. In your own words explain what a Monad is and why it is important in the composition of functions. 2. In terms of Reflex-FRP explain the following three terms behavior . event dynamic 3. Explain what a Monad Transformer does and why it is important 4. What is the difference between a partial function and a function that gives a valid result for any member of its type.
In your words explain what is RACE. Please make sure not to limit your answer just...
In your words explain what is RACE. Please make sure not to limit your answer just to the physical features. I'm interested to read your opinion on how you think the concept have been utilized at the social, economic and government levels.
Explain the two problems and solutions of “inside-out” structure of the retina with your own words.
Explain the two problems and solutions of “inside-out” structure of the retina with your own words.
Describe the ‘crowding out’ perspective on fiscal policy in your own words. In your opinion, what...
Describe the ‘crowding out’ perspective on fiscal policy in your own words. In your opinion, what are the strengths and weaknesses of this argument? Why might government spending create a larger multiplier effect when unemployment is high and have a smaller multiplier effect when the economy is at full employment?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT