Write a program that creates an array of length 10, then creates 8 threads. should request entrance to their critical sections that is controlled through semaphores, read the values written in the array, and write it to the screen with the following format: "Consumer number - consumed item number-with the value -" And to a file named "Consumer activity", then exit the critical section, and repeat till the producers stop production. The total number of elements generated by the producer and consumed by the consumers should be 10,000,000 number

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter11: Operating Systems
Section: Chapter Questions
Problem 14VE
icon
Related questions
Question

using C language

 

Write a program that creates an array of length 10, then creates 8 threads.

should request entrance to their critical sections that is controlled through semaphores, read the values written in the array, and write it to the screen with the following format: "Consumer number - consumed item number-with the value -" And to a file named "Consumer activity", then exit the critical section, and repeat till the producers stop production. The total number of elements generated by the producer and consumed by the consumers should be 10,000,000 number

Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Avoiding deadlock
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning