Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)

image text in transcribed

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: C 3 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 13152 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. 4 Vout ran alurane acei ime that the inn it will he valirl

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions

Question

7. Discuss the advantages of embedded learning.

Answered: 1 week ago