Reader & Writer problem implementation.