edited by
1,071 views
0 0 votes

Consider the following program segments for two different processes (P1, P2) executing concurrently and where a and b are not shared variables, but x starts at zero and is a shared variable

Processor #1                                                    Processor #2

            for (a = 1; a <= 3; a++)                                    for (b = 1; b <= 3; b++)

                         x = x + 1;                                                        x = x + 1;

If P1 and P2 execute only once and concurrently, then the final minimum possible value of x is ____

Please log in or register to answer this question.

Position:
Show:

Related questions

3 3 votes
0 0 answers
2.1k
2.1k views
3 3 votes
1 1 answer
96
96 views
GO Classes asked Aug 29
96 views
For a correct mechanism controlling entry into a critical section, consider the following requirements:Two processes must not execute simultaneously inside their critical...
0 0 votes
0 0 answers
2.9k
2.9k views
Raj Singh 1 asked Jan 1, 2019
2,940 views
Many problems on gateoverflow asks whether the given code satisfies progress requirement of the solution for the critical section problem. Most of these code contain mult...
4 4 votes
3 3 answers
7.2k
7.2k views
Na462 asked Jul 18, 2018
7,162 views
Consider the following code to solve the critical section problem for two processes P0 and P1. Initially flag [i] contain false for i = 0 and 1.Assume i refers to the cur...