Implemented readers and writers synchronization using semaphores