Question

In: Computer Science

This week's problems are about another concurrent processing problem: race conditions. 1. Find out what a...

This week's problems are about another concurrent processing problem: race conditions.

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


2. Which of the generic architectures considered in lectures is most susceptible to race conditions. Explain your reasoning -- why do you believe that your chosen architecture is most susceptible?


3. Be creative, but realistic: Describe an example (of your own creation) of a system that would be susceptible to a race condition, and what might happen to cause the race condition in your imagined system. Then explain what might be the effect of that race condition in your particular system. The goal in this last part is to imagine a real-world system and to describe it in a way that the marker can understand as well as showing how it could be affected by a race condition.

Solutions

Expert Solution

A race condition is a unprepared situation which occurs when two or more than two systems or threads tackle to perform two or more than two two operations at the same time or we can say that device or threads can fetch shared data and try to modifying or change it but according to the environment of device the operation perform its task correctly when its done in proper sequence.

For Example:

If a process calls a function that's proposed to increase a value (k) which is stored in a database. The function will fetch the current value from database (D) and store it in memory as a variable (E) then increment it (F) and finally write the updated value to database (G). This function's execution is a sequence of steps D-G.

Race condition will happen if process 1 calls this function and proceeds to step F. Meanwhile, it gets preempted by the operating system and another process 2 gets its chance to run. Process 2 calls the same function, completes all the steps D-G and returns. When process 1 resumes, it continues from step F using an old value (k), not process 2  result (k+1).

Race condition would not have happened if process 1 had completed all steps without preemption; or process 2 had been prevented from executing the function until process 1 had completed all steps.


Related Solutions

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.
what can you conclude about the nature of race as it plays out in the world...
what can you conclude about the nature of race as it plays out in the world of sports? Is the sports world the one true “merit” system in US society?
This week's discussion is about correlation and regression concepts. Use the internet to find a website...
This week's discussion is about correlation and regression concepts. Use the internet to find a website that shows an example or application of correlation or regression in an area of interest in your personal or professional life. Discuss how correlation or regression was used, summarize your findings, and share them. Be sure to include the independent and dependent variable – discuss the impact/relevance of the independent variable.
Write about your experiences with race. What does  race mean?  What does it mean to say race is...
Write about your experiences with race. What does  race mean?  What does it mean to say race is a social construction? How do you make sense of the existence of race, if it is not biological? You might ask how they first became aware of the concept of race. Have you lived and worked in a diverse community? School? Workplace? How has your "race" affected your life or the life of your family members? Describe your most positive and negative experiences related...
Disclosing medical conditions Another ethical dilemma is telling the patient that everything will turn out fine....
Disclosing medical conditions Another ethical dilemma is telling the patient that everything will turn out fine. Or the patient asks what her results were from biopsy. You know that the results show staged cancer, but the physician has not disclosed to the patient. What would you do?
Another coefficient mentioned in this week's readings is the coefficient of determination, r^2. What information do...
Another coefficient mentioned in this week's readings is the coefficient of determination, r^2. What information do we obtain from this coefficient?
Elementary Differential Equations Problems: 1) Find the solution of the initial value problem of y" +...
Elementary Differential Equations Problems: 1) Find the solution of the initial value problem of y" + 3y' = 0, y(0) = -2, y'(0) = 3 2) Find the general solution of the equation 4y" - 9y = 0 3) Find the general solution of the equation dy/dt = 2t(y – 2y2) 4) Given the second order linear homogeneous equation y"- 2y' + y = 0, a) Verify that y1(t) = e^t and y2(t) = t e^t are solutions of the...
Applications of Public relations planning and race process 1.1. Write about the race process. Analyse what...
Applications of Public relations planning and race process 1.1. Write about the race process. Analyse what race process is and describe each step of the process . 1.2How you would put the Race process into practice in creating a professional communication plan. try to give answer as long as you can.
What are the conditions causing linear programming problems to have multiple solutions?
What are the conditions causing linear programming problems to have multiple solutions?
In the “race” of conceptual problem 5 (and similar to what we did in lab), the...
In the “race” of conceptual problem 5 (and similar to what we did in lab), the uniform cylinder, uniform sphere, and cylindrical hoop race down a 2 meter long ramp tilted 10o to the horizontal. Each object has the same mass (10.0 kg) and radius (10.0 cm). Assume no slippage between the ramp and object and the coefficient of friction = 0.5. Calculate the following: (a) the final velocity of each (b) the center of mass acceleration of each object,...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT