Awarded

regarding semaphores and mutex locks!!!

Jurassic Park consists of a dinosaur museum and a park for safari tiding. There are n passengers and m single-passenger cars. Passengers wander around the museum for a while, then line up to take a ride in a safari car. When a car is available, it loads the one passenger it can hold and rides around the park for a random amount of time. If the m cars are all out riding passenger around, the passenger who wants to ride waits; if a car is ready to load but there are no waiting passengers, then the car waits. Use semaphores to synchronize the n passenger threads/processes and the m car threads/processes.

Submit all of your project’s source code using the submission command to the Linux server.

1. Write program in C language using Pthreads API to simulate the following IPC problem. Refer to Section 5.9.4 for specific instructions on mutex locks and semaphores.

2. If there are multiple files in your submission, you need to provide a makefile as well.

3. Make sure to use mutex locks or semaphores to synchronize the processes/threads.

4. Display messages to the screen to show the state of the system. A good way to validate your program running correctly is to perform some simple output messages to show the state of the system. You can experiment with these messages, but in general you want to demonstrate what each thread is doing. You can use an integer number to identify each thread.

5. If your program needs any arguments in command line (for example, number of passengers and number of cars), you need prompt proper message for the arguments and also valid the input.

6. You may consider how to terminate your program. There are many options. For example, terminate after serving the passengers a given number of times (each service means that one car is used by one passenger). You need to explain this in your code or output as message

Provide specific answers to the following questions.

1. How many threads/processes are there?

2. What does each thread/process simulate?

3. Will each thread/process be blocked at some time of simulation? If yes, explain the circumstances.

4. When will a blocked thread/process be waked up, and by whom?

5. How many semaphores are there in your project, what is the purpose for having each?

Skills: C Programming, C++ Programming, Database Development, Linux, Shell Script

See more: I want a logo for my company. The name of the company is morningstar education . The main business is to provide online academic, need to create a flyer want ideas, i want to write a story want some help, imagine you are living in germany in 1930 write a letter to the press explaining why the nazis would be good for germany mention, a brand want design, writing assignment a personal story and use simple past, if you wanted to move your domain and a website to another host what settings would you have to change on your domain to make it, i want to write an essay about is free education good in this essay i want mind map introduction body and conclusion, polish voices needed for a very short script few simple sentences, polish voices needed - for a very short script (few simple sentences), i need urgent help to complete a one-page website (pretty simple) it has a prototype currently 20% completed, i have a logo want a designer to improve it, banker algorithm project using pthreads mutex locks, banker algorithm using pthreads mutex locks project, want general knowledge questions answers

About the Employer:
( 0 reviews ) United States

Project ID: #15643920

1 freelancer is bidding on average $40 for this job

gaurav5670

Hired by the Employer

$40 USD in 1 day
(13 Reviews)
3.1