Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Three processes share a global variable x , and each process ( named P; in a mixed syntax ) performs the following: int k; /
Three processes share a global variable x and each process named P; in a mixed syntax performs the following:
int k; local variable
for k ; k ; k
LOADx; INCREMENTx; STOREx;
That is each process executes x; five times, but each assignment is realized in three steps using its own local register. Now consider the following parallel program:
x ;
run P; run P; run P;
Can the final value of x be as small as or Check possible outcomes using Spin, explain the results, and generalize them.
Hint:
Model the three processes and the main init program in Prolmela by implementing the behavior of LOAD, INCREMENT, and STORE using the constructs of Promela eg local variables
Suppose you think x can be but not less. Then you should: a verify that x is a possible outcome upon termination. This can be done by asserting that, when only one process the main process remains active after three run P; x cannot be The number of active processes can be obtained by the nrpr special variable or by counting them explicitly. b Verify that x is not a possible outcome upon termination.
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