Question: You have to use C/C++ Programming language for above quesitons 1 (10) Three processes are involved in printing a file (pictured below). Process A reads

 You have to use C/C++ Programming language for above quesitons 1

You have to use C/C++ Programming language for above quesitons

1 (10) Three processes are involved in printing a file (pictured below). Process A reads the file data from the disk to Buffer 1, Process B copies the data from Buffer 1 to Buffer 2, finally Process C takes the data from Buffer 2 and print it. Process A Process C Process B Buffer 1 -- copy Buffer 21 Read from File print Assume all three processes operate on one (file) record at a time, both buffers' capacity are one record. Write a program to coordinate the three processes using semaphores. (10) 2 Write a code that prints "Are Roses Red? in console. Your code should have 5 threads. Thread one will print: Are" Thread two will print: "Roses" Thread three will print: "Red" Thread four will print: "?" And thread 5 will print all necessary spaces. [You will need semaphore for proper synchronization]

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!