Question: Using Linux. multi threading and multi processing. This has to be done through the command window or terminal. Please also explain how you arrived at
Using Linux. multi threading and multi processing. This has to be done through the command window or terminal. Please also explain how you arrived at your answer.

Create a program (matrix.c) in C to multiply two matrices in the following fashion: a. The main process (parent process) will create multiple child processes. Each child process will solve part of the matrix multiplication problem in the following way: Given two matrices A and B: 7 2 3 4 5 6 11 12 A= B= 58 64 139 154 The result of A x B is: Where: 58 = (1 x 7) + (2 x 9) + (3 x 11) //first row of A, first column of B 64 = (1 x 8) + (2 x 10)+(3 x 12) //first row of A, second column of B 139 = (4 x 7) + (5 x 9) +(6x 11) 1/ second row of A, first column of B 154 = (4 x 8) + (5 x 10) + (6 x 12) /second row of A, second column of B The work required to perform this multiplication can be divided in 2 parts (1 part per row in the final matrix). Each part will be assigned to a different child process. The first child will compute the result of (1 x 7) + (2 x 9) + (3 x 11) and (1 x 8) + (2 x 10) + (3 x 12), and so on. Note that the final result can be constructed from the partial results. In general, you will create as many child processes as the number of rows in A x B. b. Each child process will send its partial results to the parent process. The communication should be implemented using pipes. c. The parent process will construct the final result using the partial results received from all the children. Use the following code as a starting point for your solution (matrix.c). #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
