Included in this directory are a number of skeletal code fragments, which you can fill out to solve various synchronization problems.
And see Allen Downey's book, "A Little Book of Semaphores", for even more fun. It's also free!
To compile any one of them (say, one called foo.c
):
prompt> gcc -o foo foo.c -Wall -pthread
And then, to run it:
prompt> ./foo
(maybe with some optional arguments)