sriharsha.avss
12-01-2007, 10:12 PM
First Java Project Edit A multiple producer and consumer emulation program 1. Problem description There are M producer, N consumer and B bucket For each producer, it will look for a bucket that is not full, and fill a product into that bucket. It will wait if it could not find an empty bucket after check the all the bucket. (note a fact: when a producer is checking bucket i, another consumer or producer should not be blocked if it try to produce to or consume from buckt j when i!=j For each consumer, it will look for a non empty bucket and featch a product from that bucket. It wil wait if it could not find an nonempty bucket to consume after checking all the B bucket. Just like a producer, when a consumer is checking bucket i, another produce or each consumer, it will look for a non empty bucket and featch a product from that bucket. It wil wait if it could not find an nonempty bucket to consume after checking all the B bucket. Just like a producer, when a consumer is checking bucket i, another producer/consumer should not be blocked if it trys to access bucket j when i!=j; After a producer or a consumer check a bucket, no matter success or not, it will sleep for a random time = 1000 * random() Other requirement * Print out the bucket count after each action (consume or produce) * Print out other necessary message * M, N, B are changable.
can u peple do dis porgram for me its very urgent i hav a lot of work to do :( :confused:
can u peple do dis porgram for me its very urgent i hav a lot of work to do :( :confused: