In the parallel section of the program, the task of generating numbers is assigned to Thread 0 and the task of printing the numbers is assigned to Thread 1. Printf("Thread %d Printing numbers.\n", omp_get_thread_num()) Printf("Thread %d generating numbers.\n", omp_get_thread_num()) Printf("There are %d threads\n", omp_get_num_threads()) ![]() Printf("Please Enter the series limit\n") (click “ view source” or “ copy to clipboard” button on the top right corner of the code section to copy or save the source code) ![]() One thread has to generate the numbers up to the specified limit and another thread has to print them. Design develop and run a multi-threaded program to generate and print Fibonacci series.
0 Comments
Leave a Reply. |