Reference no: EM131608418
Exercise: UNIX system programming
Learning objectives
1. Grok POSIX threads
2. Grok thread synchronization using mutexes & condition variables
3. Simple system administration tasks on UNIX
4. Experience some parallel algorithms implementation
Cover Story -
In this exercise, you will build your own thread pool manager. The system will be composed of three main components:
1) Thread Pool Manager - Responsible of distributing tasks amongst its available threads
2) Task Feeder - Responsible of loading new tasks into the Thread Pool Manager (Bonus)
3) Main application - The main application (thread) is responsible for approximating PI using the Monte-Carlo method.
Exercise 1 - Thread Pool Manager
The thread pool manager has N available threads (N is given as a parameter to the program). The thread pool manager always waits for new tasks (separate thread) to be added by the Task Feeder (Bonus) or simply by assigning it tasks from main. These tasks should then be distributed between the available worker threads.
Note that the tasks are completely oblivious to the thread pool manager.
Exercise 2 - Main Application
The main application is responsible for approximating PI using the Monte-Carlo method.
1) The main application receives as a parameter the number of iterations to be done by the Monte-Carlo method to estimate PI.
2) The main application is the only component familiar with the calculation.
3) The main application must define a set of tasks (Divide and Conquer) to be handed to the Task Feeder (Bonus) or simply hands it to the Thread Pool Manager by itself. Each task is responsible for solving its relative part of the PI approximation calculation.
The main application needs to combine the sub-solutions to an overall solution.
Exercise 3 -Task Feeder
The main application, the only one familiar with the actual "work", defines a set of tasks to be handed to the Task Feeder. The task feeder is then responsible to load these tasks to the Thread Pool Manager.
Attachment:- Assignment File.rar
|
Calculate and print the total of yesterday receipts
: (Parking Charges) A parking garage charges a $2.00 minimum fee to park for up to three hours and an additional $0.50 per hour for each hour.
|
|
What are two ratios that measure liquidity
: What are two ratios that measure liquidity? What is the primary difference between financial statement analysis and operational analysis?
|
|
Windows standards for menus
: Discuss the benefits of following Windows standards for menus, positioning of buttons, colors, etc. Answers might include user familiarity and comfort
|
|
Describe how race and gender shape a persons life
: Thinking about these ideas, describe how race and gender shape a person's life. Which is most powerful in a person's life: race, gender, or class?
|
|
Unix system programming
: Exercise: UNIX system programming. In this exercise, you will build your own thread pool manager
|
|
Calculate the cost of debt capital
: Calculate the cost of debt capital? Calculate the cost of debt capital for 2018.
|
|
Describe the task or service the gadget will perform
: Describe the task or service the gadget will perform.Give it a name. Explain what it looks like - color, size, and shape.What materials is it made of?
|
|
Discuss job search and performance on the job
: address networking, continuing education, job search and performance on the job.
|
|
Cascading style sheet
: Deliverables: One (1) Web page and one (1) Cascading Style Sheet (.css), including the image file.
|