Question: copy of th program n22APMis skelt55 also in the same directory, and name it pthreads pi.cpp Note the use of the pthread create function in

 copy of th program n22APMis skelt55 also in the same directory,

copy of th program n22APMis skelt55 also in the same directory, and name it pthreads pi.cpp Note the use of the pthread create function in main). Read the Linux manual page that describes the pthread create function [URL and make sure that you understand the functionality that pthread create provides and how to call (invoke) this function. Modify the program to declare and initialize a global array named my_messages to the messages below English:Hello!" French: Bonjour!" Spanlish: Holal" German: Guten Tag! comment that says "TODO: Modify according to assignment requirements and the "if (rc) check). So, each thread will essentially execute the same function, but will print a different message based on the parameter it receives 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 different order of greetings: Englishi Hellet Cerman: Guten Tagt Pinclade Spthrcad.ho Pinclade ciostroam sing mamcspace sdt This function shows the skeletom that pehrcad functioas must adhere to. Copy this skelcton for amy pthrcad function you need to define. In the copy. modify the namg of the fanction and the function body as needed void "routincNamlvoid arg // TODO: AA code hat implements the thread's functionality cout "Thread is renning.. o endl: retum & inlman N id is wsed to store a unique thread identifier W retumed by the call to create a new POSIX thread pthread t id W re is used to store the code returnod by the W call to crcate a new POSLX thrcad. The value is N zero (0) if the call sacceeds TODO: Add code to perfeem any noeded initialiration W or to process User ispui Create thread s) ec phread createl&id, NULL, routineName, NULL) f(re) retarm -1: NOTE: Using exit here will immediately end execusion of all threads

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!