a writers-prefence solution for readers-writers problem