(C PROGRAM ONLY) Multi-thread in C programming - POSIX thread / pthread Please read the instructions carefully and show

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

(C PROGRAM ONLY) Multi-thread in C programming - POSIX thread / pthread Please read the instructions carefully and show

Post by answerhappygod »

(C PROGRAM ONLY)
Multi-thread in C programming - POSIX thread / pthread
Please read the instructions carefully and show theoutput. Write a multi-thread program to handle two matrices, Aand B. Randomly generate the content of matrix A and B withspecified dimension provided as two command arguments. Dimension ofA and B must be the same. Then create three threads:
a. one thread will transpose the A and B
b. one thread will calculate addition of two matrices as C = A +B
c. one thread will calculate subtraction of two matrices as C =A - B
Print out the results for each thread. Remember to allocatespace for C and the transposed A and B.Do a random number generator for numbers in the array. Randomlygenerate elements of the matrix
USE MALLOC to separate memory address when transpose a totranspose bRows and columns should be switched, the i and j should switch
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply