Jurassic Park consists of a dinosaur museum and a parking lot from where people leave for safaris.
Fantastic news! We've Found the answer you've been seeking!
Question:
Jurassic Park consists of a dinosaur museum and a parking lot from where people leave for safaris. There are m passengers and n safari cars, each with only one passenger. Passengers visit the museum for a while, after which they line up to get into a car. When a car is available, the individual passenger is picked up and the safari is done for a certain period of time. If there are no cars available, passengers wait; if there are no passengers available, the cars wait. Write a solution (C-like pseudocode) to this problem using special machine instructions (compare&swap or exchange). Also, a solution with semaphores and one with message passing would be really helpful,
Posted Date: