Question: Writhe the pseudocode to solve the matrix problem. 1 . int data [ 3 ] [ 3 ] records a 3 by 3 matrix. 2
Writhe the pseudocode to solve the matrix problem.
int data records a by matrix.
You need to create three worker threads by call pthreadcreate in the main function.
The firstcreated worker thread calculates the sum in the first line of the matrix; the secondcreated worker thread calculates the sum in the second line of the matrix; and The thirdcreated worker thread calculates the sum in the last line of the matrix.
The main function receives the result of each line from a worker thread and prints total sum.
Synchronize the worker thread and the main function.
In your pseudocode, you need to clearly specify the input arguments in pthreadcreate. You also need to clearly indicate the seminit, semwait and sempost if you use semaphore in your pseudocode.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
