Question: Please answer this question properly. Thanks! 6. It is a historic day in Canada as the government has decided to make their data easier to

 Please answer this question properly. Thanks! 6. It is a historic

Please answer this question properly. Thanks!

6. It is a historic day in Canada as the government has decided to make their data easier to access. They have provided a library of functions that can be called to retrieve information if you can give a person's Social Insurance Number (SIN). Three such functions include: a. int sin_voted (int sin) - will retum 1 if the person voted in the last election, O otherwise, b. int sin_employeed(int sin) - will return 1 if the person was employed last year, o otherwise. c. int sin_retired( int sin) - will return a 1 if the person collected a pension last year, 0 otherwise. You are to write a multithreaded program that calculates various statistical values for a list of SIN numbers. This program will read a series of numbers from standard input (scanf()) and then will create three separate worker threads. One thread will determine the number of voters, the second will determine the number of employed people and the third will determine the number of retirees. You are to use mutexes or semaphores, NOT pipes, to communicate the SIN numbers to each of the worker threads. For example, suppose your program is passed the SIN numbers 123456789 987654321 111222333 333222111 123123123 The program will report The number of voters is 4 The number of employed people is 2 The number of retired people is

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!