Instructions: The purpose of this lab is to continue pthreading, which will be the modeling used for parallalism. Please implement the following functions: // Write the following function to return...


C++ Programming


Instructions: The purpose of this lab is to continue pthreading, which will be the modeling used<br>for parallalism.<br>Please implement the following functions:<br>// Write the following function to return the number of primes using the<br>|// producer consumer code in class<br>long find_number_of_primes(const int num_consumers, const unsigned long highest) {<br>long sum = 0;<br>return sum;<br>// Now extend the first function to create any number of producers<br>// Give each prodcuer a equal range to producer for the consumers.<br>find_number_of_primes_mp(const int num_producers, const int num_consumers,<br>const unsigned long highest) {<br>long sum = 0;<br>return sum;<br>// Finally extend the first function to have each consumer search a range<br>// of numbers. I recommend editting pargs_t to contain the range.<br>// This has one producer.<br>long find_number_of_primes_chunk (const int num_consumers,<br>const unsigned long highest,<br>const unsigned long chunk) {<br>long sum = 0;<br>return sum;<br>

Extracted text: Instructions: The purpose of this lab is to continue pthreading, which will be the modeling used for parallalism. Please implement the following functions: // Write the following function to return the number of primes using the |// producer consumer code in class long find_number_of_primes(const int num_consumers, const unsigned long highest) { long sum = 0; return sum; // Now extend the first function to create any number of producers // Give each prodcuer a equal range to producer for the consumers. find_number_of_primes_mp(const int num_producers, const int num_consumers, const unsigned long highest) { long sum = 0; return sum; // Finally extend the first function to have each consumer search a range // of numbers. I recommend editting pargs_t to contain the range. // This has one producer. long find_number_of_primes_chunk (const int num_consumers, const unsigned long highest, const unsigned long chunk) { long sum = 0; return sum;

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here