in Operating System
516 views
1 vote
1 vote

Variable X starts at zero and is a shared variable.  Variables A and B are not shared variables.

If Processes P1 and P2 execute only once at any speed, the largest possible value of X is ____.

in Operating System
516 views

1 Answer

0 votes
0 votes

The largest value of X possible is 4.

P2 will run only one time and P1 will run for two times so we execute P2 first and then two times P1.

Giving us X = 4.

Related questions