Write a code to pass a simple integer to each thread and measure time taken by each thread with out and with pthread_join. The calling thread uses a unique data structure for each thread, insuring that each thread's argument remains intact throughout the program.
Solution: 1) with our pthread_join //Write a code to pass a simple integer to each thread. The calling thread uses a unique //data structure for each thread, insuring that each thread's argument remains intact //throughout the program. // we try to display the massages based on user's imput through scanf // we try to find the time taken by each thread #include <pthread.h> #include <stdio.h> #include <stdlib.h> #include <time.h> #define NUM_THREADS 8 // define total no of threds as global variable char *messages[NUM_THREADS]; // define the pointer globally to pass massage // pthread function void *PrintHello(void *threadid) { long taskid; sleep(1); taskid = (long) threadid; printf("Thread %d: %s\n", taskid, messages[taskid]); pthread_exit(NULL); } int main(int argc, char *argv[]) { clock_t tm1,tm2; double time_taken; pthread_t threads[NUM_THREADS]; // define pthread id long taskids[NUM_THREADS]; // define taskid int rc, t, NUM;...