Question: Multithreading: Concurrency. Consider the following code runs in a multi - threaded environment: uint 6 4 _ t counter; void incrementVariable ( ) { counter

Multithreading: Concurrency.
Consider the following code runs in a multi-threaded environment:
uint64_t counter;
void incrementVariable()
{
counter++;
}
If the initial value of counter was 100, what are the possible values of counter after calling incrementVariable() from 2 different threads? Each of the two threads calls the function exactly one time.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!