给大家出个多进程的题# Programming - 葵花宝典
l*c
1 楼
今天下午没事编出来个题,呵呵。
Implement a multi-consumer multi-producer model such that:
1. each consumer could consume multiple resources at a time, which means each
consumer must get a given number of resource at once. The interface of the
consumer would look like: void consumer(int n) where n is the number of resource it
needs at once.
2. each producer produces multiple resources, similar like the consumer.
3. The consumers are served on a less-demond-first-serve basis, such that at
each time the consumer
Implement a multi-consumer multi-producer model such that:
1. each consumer could consume multiple resources at a time, which means each
consumer must get a given number of resource at once. The interface of the
consumer would look like: void consumer(int n) where n is the number of resource it
needs at once.
2. each producer produces multiple resources, similar like the consumer.
3. The consumers are served on a less-demond-first-serve basis, such that at
each time the consumer