Question: CPSC340- Operating System Spring 2019 Assignment 3 (25) Title: Semaphore programming Due Date: Thursday, 03/07/2019 This time you need to rewrite a multithreaded Pthread program

 CPSC340- Operating System Spring 2019 Assignment 3 (25) Title: Semaphore programming

CPSC340- Operating System Spring 2019 Assignment 3 (25) Title: Semaphore programming Due Date: Thursday, 03/07/2019 This time you need to rewrite a multithreaded Pthread program that works with sleep() or pthread join() in order to print out Fibonacci sequences properly. Create a folder name, WK6 on your class Linux machine when you work. gce assignment 3.c-Wall-Werror-pthread You are required to develop your own program using C with the following information: Need to declare a function that receives Fibonacei number and prints Fibonacci sequence upon each Fibonacci number; . o Fibonacci count numbers with corresponding thread-name would be read using shiuMc main ( int arge, char argv 1) function. 4 Fibonacci numbers are entered on the command line such as: John 9 Doe 13 ESU 7 CPSC 9; Each Fibonacci number is executed by each thread shown below; o The program needs to create separate threads such that: . o Thread 1 with your first name, followed by the Fib sequence data; o Thread 2 with your last name, followed by the Fib sequence data; o Thread 3 with "ESU" followed by the Fib sequence data; o Thread 4 with "CPSC" followed by the Fib sequence data; The parent thread will print the sequence with the thread name printShare); o void printShare o pthread mutex lock(&lock); o write or printf (Each Fib sequence that begins with name); o pthread_mutex unlock&lock); You may implement your program such as: . Implement as is without using sleep(), pthread_join(), or other functions on pp.136-137 of the OS textbook. Implement it after adding those statements

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!