The following two functions P1 and P2 that share a variable B with an initial value of 2 execute concurrently.
P1() {
C = B - 1;
B = 2 * C;
}
P2(){
D = 2 * B;
B = D - 1;
}
The set of distinct values that B can possibly take is ?
My understanding: Say P1 executes first , then B=2, after that P2 executes next then value of B=3. Again P1 executes and we get B value as 4, yet again B executes and we get B value as 7 etc. So does this mean B will take up infinitely many values? The order of my execution is P1-P2-P1-P2-P1.... Is this correct?