Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Implement the Producer-Consumer Problem: Use processes to simulate producers and consumers, and let all of them share a buffer with size 10. The buffer contains
Implement the Producer-Consumer Problem: Use processes to simulate producers and consumers, and let all of them share a buffer with size 10. The buffer contains random capital letters 'A'-'Z'. In the simulation scenario, set 2 producers and 2 consumers, let each of them access and change the buffer for 5 times in random time intervals. Use semaphore for process synchronization. Output the process execution sequence, and the buffer every time a producer or consumer changes it. Use C/C++ to simulate a file directory system for Linux that: supports following commands: login: user login dir: output all subdirectories and files under current directory mkdir: create a new directory cd: change directory create: create a new file delete: delete a file read: read a file write: write a file implements read/write protection. Your program should allow the user to type the above commands in a terminal after login, and you may also let the user directly input file content in the terminal
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started