(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
(C PROGRAM ONLY) Multi-thread in C programming - POSIX thread / pthread Please read the instructions carefully and show
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am