producer consumer problem in ruby