Question: Please do it in C++ only You must complete the program below (using POSIX threads) that creates n threads (where n is the number of

 Please do it in C++ only You must complete the program

Please do it in C++ only

You must complete the program below (using POSIX threads) that creates n threads (where n is the number of characters to find in the message) to determine the frequency of a set of symbols (string) in a message (string). Each child thread receives the character to search in the message (char), a pointer to the message (string *), and a pointer to store the calculated frequency (int *). This last pointer is a memory location accessible by the parent thread. The program's input is a string representing the set of symbols (characters) to search in the message, followed by another string representing the message. Given the following input: C3 COSC 3360 FALL 2022 - RINCON Three child threads are created: The first child thread calculates the frequency of the character ' C ' in the message. The second child thread calculates the frequency of the character ' ' in the message. And the third child thread calculates the frequency of the character ' 3 ' in the message. The expected output by the parent thread is: Frequencies: C: 3 :5 3:2 Notes: 1. Not using POSIX threads will translate into a penalty of 100%. 2. You cannot modify the structure used to pass the arguments from the parent thread to the child threads. 3. Follow the instructions provided in the template file to complete your solution

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!