Consider the following code , If the object of a Seq class
is concurrently accessed by 2 threads: (t1) and (t2) and they call
the Increment3() method each one time .
class Seq{
private int count=0;
public int Increment3(){
count+=3
return count;
}
}
Draw the trace diagram of the execution of the above code
explaining the final value of the variable count where the threads
are interleaved before storing the value of count.
-answer quickly
Consider the following code , If the object of a Seq class is concurrently accessed by 2 threads: (t1) and (t2) and they
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am