Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is an Operating Systems related task. Please provide a heading for each code segment as named in the picture, so that I know which

image text in transcribed

This is an Operating Systems related task.

Please provide a heading for each code segment as named in the picture, so that I know which code goes into which file in my computer.

Please do not submit an inaccurate code that doesn't work as mentioned in the question. Only submit after checking that it works as intended.

I will leave a thumbs up as soon as I see the answer is accurate.

- Write two C programs for Linux that use the IPC (inter process communication) signals. - Both programs have to run in different shell (terminal) windows on the same system. - The first program is called "papermachine.c" and the second one is called "paperbox.c". - papermachine.c represents a worker who is responsible for making paper from wood pulp. - paperboxes.c represents a worker who is making paper boxes using paper. - Both the processes are able to run in parallel. The product of papermachine.c (paper) is delivered to paperboxes.c, and paperboxes.c needs the paper to work. - Therefore, if the paperboxes runs out of paper, it sends a signal to the papermachine to provide it with more paper. - Paper is prepared in the following way: A fixed small delay (e.g., 0.3 seconds) is needed to prepare the paper. - The machine does not deliver the paper unless a total of 10 yards of paper are completed. - A variable goes from 0 to 10 when the paper is fully prepared. - When paper is delivered, this variable goes to 0 and starts over. Muhammad Salman Chaudhry, Computer Science Department, FCC University (www.fccollege.edu.pk) P age 2 of 2 - The paperboxes goes into waiting if the paper is being prepared, and his batch is fully converted to boxes. - Paperboxes works in the following way A fixed small delay (e.g., 0.4 seconds) is needed to make one box. One batch of paper can only be used to make 5 boxes. A variable goes from 0 to 5 when a batch is complete. - When the batch is complete, this variable goes back to 0 and starts over. - The papermachine goes into waiting if the boxes are being made, and paper is new paper is not needed by paperboxes. - Use the kill() system call and User-Signals to simulate the behavior mentioned above. - Messages/symbols on each terminal should be printed at least in case of the following events. - The paperboxes goes into waiting due to no paper. - The paperboxes starts making boxes. - Each time paperboxes makes one box. - The paperboxes finishes making boxes. - The papermachine goes into waiting due to boxes being made. - The papermachine starts making paper. - Each time the papermachine makes one yard of paper. - The papermachine finishes making paper. - You can improve the appearance and display of the simulator to as much extent as possible for you. SUBMISSION DETAILS 1. File 1: papermachine.c (the program must compile without any errors and work as described above) 2. File 2: paperboxes.c (the program must compile without any errors and work as described above)

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

Database Systems For Advanced Applications 17th International Conference Dasfaa 2012 Busan South Korea April 2012 Proceedings Part 1 Lncs 7238

Authors: Sang-goo Lee ,Zhiyong Peng ,Xiaofang Zhou ,Yang-Sae Moon ,Rainer Unland ,Jaesoo Yoo

2012 Edition

364229037X, 978-3642290374

More Books

Students also viewed these Databases questions

Question

1. Identify six different types of history.

Answered: 1 week ago

Question

2. Define the grand narrative.

Answered: 1 week ago

Question

4. Describe the role of narratives in constructing history.

Answered: 1 week ago