Exercise unix system programming in this exercise you will


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

Request for Solution File

Ask an Expert for Answer!!
Operating System: Exercise unix system programming in this exercise you will
Reference No:- TGS02403958

Expected delivery within 24 Hours