In this section, we’ll write some simple multi-threaded programs and use a specific tool, called helgrind, to find problems in these programs.
Read the README in the homework download for details on how to build the programs and run helgrind.
Questions:
1. First build main-race.c. Examine the code so you can see the (hopefully obvious) data race in the code. Now run helgrind (by typing valgrind --tool=helgrind main-race) to see how it reports the race. Does it point to the right lines of code? What other information does it give to you?