a version of Reader /writer that uses my implementation of semaphores