edited by
669 views
0 votes
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 ____

edited by

Please log in or register to answer this question.

Related questions

0 votes
0 votes
0 answers
2
Raj Singh 1 asked Jan 1, 2019
1,386 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...
0 votes
0 votes
0 answers
4
Akash Kumar Roy asked Mar 31, 2018
275 views
Is context switch allowed when a process is in the cirtical section? (Not preemption)If yes then how it deals with data inconsistency?