Question: copy of the program n4 24 PMis skeleton.cpp, which is C also in the same directory, and name it pthreads pl.cpp Note the use of
copy of the program n4 24 PMis skeleton.cpp, which is C also in the same directory, and name it pthreads pl.cpp Note the use of the pthread create function in main). Read the Linux manual page that describes the pthread create function [URL pthread create] and make sure that you understand the functionality that pthread create provides and how to call (inwoke) this function. Modify the program to declare and initialize a global array named my messages to the messages below English:Hello!" French: Bonjour! Spanish: Hola! comment that says TODO: Modity according to assignment requirements" and the if (ro) check). So, each thread will essentially execute the same function, but will print a different message based orn the parameter it recelves. 6. Compile your program and run it several times. Note that the output of your program is likely to look garbled and may not always show the greetings in the same order. Run the program multiple times until you are confident that all of the threads are executing. Expected Output: Your program should produce the following output, but possibly with a Englishi Hette erman: Guten Tag different order of greetings: Main Code ncludepthread.h- using namespace sad This fanction shows the skelcton that pehrcad functions must adhere to Copy this skeleton for any pthread function you need so define, In the copy, modify the name of hc function and the function body as needed void routincNama void "arg TODO: Add code that implements W the threads functionality cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
