A producer-customer model to solve the problem.