Question: Consider the following program: a. Determine the proper lower bound and upper bound on the final value of the shared variable tally output by this

Consider the following program:

const int n = 50; int tally; void total () { }

a. Determine the proper lower bound and upper bound on the final value of the shared variable tally output by this concurrent program. Assume processes can execute at any relative speed, and a value can only be incremented after it has been loaded into a register by a separate machine instruction.
b. Suppose that an arbitrary number of these processes are permitted to execute in parallel under the assumptions of part (a). What effect will this modification have on the range of final values of tally?

const int n = 50; int tally; void total () { } int count; for My } (count = tally++; void main() { 1; count

Step by Step Solution

3.29 Rating (167 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

ANSWER a The proper lower bound on the final value of the shared variable tally output by this concu... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Operating Systems Internals And Design Principles Questions!