How to compile your program including the actual compile


Problem 1 (C++ program that should run on Unix server)

Only two websites allow are and should be referenced in code. 

https://computing.llnl.gov/tutorials/pthreads/

https://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html

At a particular college, there are two admissions counselors, and five parking spots near the admissions office for visitors. There are 100 prospective students driving around trying to park and perform their admissions interview. When a prospective student sees a parking spot, he/she (generic he from now on as your book uses) pull into the spot, wait to be advised and then leave(freeing a parking lot space for one of the ones driving around). The advisors will advise a prospective student and then select one of the remaining students in the parking lot to advise next. If there are no prospective students in the parking lot, the tired advisor snoozes at his desk.

You will need your program to start 100 "prospective student" threads and two councilor threads. Each thread should print a message when it is created. Students should print when they get parking spaces and when they are advised.

When compiling, compile using the -lpthread flag. So for example, if you wrote the program as a c++ program in a file called problem1.cpp you might use

g++ -g -lpthread problem1.cpp -o problem1

Submitting:

In addition to the solutions to your programs above, you need to write a readme.txt it should contain

Well commented program. 

how to compile your program (including the actual compile command) and how to run it (including command line arguments, if any)

A description of your solution to these two problems, including what you did to solve the problem, and why you did it that way

A description of what problems still exist, what doesn't quite work right and so on.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: How to compile your program including the actual compile
Reference No:- TGS0660481

Expected delivery within 24 Hours