Question: Suppose that you mistakenly create an automatic (local) variable v in one thread t1 and pass a pointer to to v to another thread t2.
Suppose that you mistakenly create an automatic (local) variable v in one thread t1 and pass a pointer to to v to another thread t2. Is it possible that a write by t1 to some variable in other than v will change the state of v as observed by t2? if so, explain how this can happen and give an example. If not, explain why not.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
