Reference no: EM13321810
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.
What advantages might a socialist system
: What advantages might a socialist system have responding to the needs of people struck by an emergency situation like the earthquake that occurred in Haiti in January of 2010
|
What changes in society helped starbucks become successful
: What advantages does McDonald's have in competing with Starbucks for coffee sales? What changes in society helped Starbucks become successful? What strategic factors account for Starbuck's long-term success in building brand equity? What recommendati..
|
Staff development programs to their curriculum
: What measures can schools take to align their staff development programs to their curriculum? Provide a rationale for the measures suggested.
|
Community hospital uses a job-order costing system
: Southwest Community Hospital uses a job-order costing system to track charges for each patient. The following charges relate to Candice O'Dea, who had laparoscopic knee surgery:
|
How to compile your 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..
|
Solve the currently very un-pc cigarette smokers problem
: Write solution to solve the currently very un-PC"cigarette smokers problem" in java using Java threads, and monitors (using the "synchronized" keyword) (If it bothers your PC sensibilities, think of it at the Pot-smokers problem and then it is all pr..
|
Personal pollution-water pollution-air-noise-heat pollution
: Remember that after you stand up from bed in the morning almost every activity of your day is going to produce some kind of pollution. Personal pollution could include: water pollution, air pollution, noise pollution, heat pollution, solid waste poll..
|
Null and entity subtypes
: Describe the relationship between columns that can be null and entity subtypes. Under what circumstances would these columns lead to more than one entity subtype?
|
Delegation is a key role for all health professionals
: Delegation is a key role for all health professionals. What are three factors to consider when delegating to unlicensed personnel in the health care setting?
|