Simulation of producer and consumer problem