The program problem3.cpp
has the same problem as problem 1--first, the threads don't actually
run. Fix this problem, and then you'll see the "do_work"
routine's printouts get
messed up when the kernel switches between threads, like this:
a0, b0,B0
b1,B1
A0
a1,A1
a2,A2
...
Change
thread_routine so that each call to "do_work" is atomic, in the sense
that no two threads will run do_work simultaniously, and the printouts
from one execution of do_work should appear together, like this:
a0,A0
b0,B0
b1,B1
a1,A1
a2,A2
...
You CANNOT change the "do_work" routine.