Inglese
The example program below contains a common threading error. When I first started programming with threads, this was the first race condition to bite me. The program uses Pthreads because that's what I was using at the time.
The program creates four threads that each print a message with a unique id number. Like many threaded programs, it sometimes works correctly even though it contains an error. Can you spot the race condition?