Question: 1 Threads You'll write a multithreaded program to look for the longest sequence of digits in the first 10000 digits of pi such that the

 1 Threads You'll write a multithreaded program to look for thelongest sequence of digits in the first 10000 digits of pi suchthat the last digit in the sequence is the sum of theprevious digits in the sequence. You may work alone or with a

1 Threads You'll write a multithreaded program to look for the longest sequence of digits in the first 10000 digits of pi such that the last digit in the sequence is the sum of the previous digits in the sequence. You may work alone or with a partner. You'll do this in by writing two functions: int readFile(char *filemame, int *numChars, char *buffer); void *findMaxSumSeq (void *param); These functions are described below. 1.1 Example program First, get pthreads-example-simpler.c from the class gitlab repo. Compile this and run it. This program shows an example of how to create pthreads and pass data to them. On silk, you will need to compile this in the following way: $ gcc pthreads-example-simpler.c -lpthread You can also run this on macOS (and possibly on Windows?). To compile it at the command line on macOS: $ gcc pthreads-example-simpler.c 2 Reading a File Create your own file threads.netid.c Then, write the function int readFile(char f ileName, int *numChars). This file will read lines from the specified file and will put each of these lines into a large character buffer. On success, it will return zero; otherwise, it will return a nonzero value. Here's how you'll call your function: \#define BUFLEN 10100 int main(int argc, char *argv[]) \{ int rc, numChars; char buffer [BUFLEN] ; if (argc

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!