The problem can also be generalized to have multiple producers and consumers.
该问题也能被推广到多个生产者和消费者的情形。