留学生作业代写do not hesitate to contact me!
WeChat:lovexc60
A process is meant to achieve a specific purpose. Different processes achieve different pur
There are two ways processes can communicate with each other: either by sharing data or by
One of the most famous and essential problems in interprocess communication via shared
In this assignment, we will implement an extension to the producer-consumer problem: the
You will solve this problem in the context of a busy day at the restaurant, where you have two
You are the owner of a locally beloved fine-cuisine restaurant, and your establishment has
You will thus be in charge of organizing your two specialized chefs (represented by two
1. Donatello specializes in non-vegan dishes:
(a) Fettuccine Chicken Alfredo
2. Portecelli specializes in vegan dishes:
(a) Pistachio Pesto Pasta
A chef should randomly pick between either of their specialized entr´ees, and add it to the
The three consumer processes are each programmed as an infinite loop() of customers:
1. The first process will represent customers that want any non-vegan dish.
A customer needs to wait if there’s not enough of any of their desired dishes. The chefs
Before beginning part one, you need to understand how to create child processes, how to
1. Creation of multiple child processes using fork(), and the ability to run specific func
2. Data sharing using mmap(), so that we can share the bounded-buffers and the
3. The utilization of POSIX semaphores as a tool for process synchronization.
poses. However, it is oftentimes the case that two or more processes need to share, or
exchange data, in order to perform their required duties; this is what is called Interprocess
communication. Your assignment is to make use of the interprocess communication tech
niques discussed in class in order to simulate a busy day at the restaurant.
sending messages. This assignment will require you to share data between multiple processes.
memory is the producer-consumer problem, also called the bounded-buffer problem. In such
a problem, we have two processes: one called the producer and the other the consumer,
and additionally, there is a bounded buffer in shared memory that both the producer and
consumer write to and read from. The producer is in charge of adding items to the bounded
buffer, and the consumer is in charge of removing them. If the buffer is full, the producer
waits until a consumer takes something. If the bounded buffer is empty, the consumer waits
until the producer adds something.
multiple-producer multiple-consumer problem. It is identical to the consumer-producer prob
lem, except as the name implies, multiple processes can produce, and multiple problems can
consume. Also, there may be more than one bounded buffer.
producer processes (chefs), three consumer processes (customers), and two bounded buffers
(food trays).
been reserved for an upcoming high-profile event. However, the organizers are adamant that
large amounts of food not be prepared in advance, but rather, your chefs should cook fresh
entr´ees and add them to their respective food trays all throughout the duration of the event.
producer processes) to constantly resupply two trays of entr´ees (represented by two bounded
buffers), for three queues of hungry customers to take from (represented by three consumer
processes). Each chef specializes in 2 entr´ees, and they strictly add items only to their
respective tray (buffer):
(b) Garlic Sirloin Steak
(b) Avocado Fruit Salad
entr´ee tray at a random rate between 1 and 5 seconds (inclusive).
2. The second process will represent customers that want any vegan dish.
3. The third process will represent customers that want one of each.
need to wait if any of their respective trays are full. After a customer takes an item, the
respective customer process should wait 10-15 seconds (inclusive) before iterating again.
share data between them, and how to synchronize them such that there are no race conditions
between them, which occur when two or more processes want to alter the shared data at the
same time. In particular, we need to have an understanding of the following functionalities:
tionality on each child process
semaphores between the processes