Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this project students will design, implement, and evaluate a computing-based solution to meet a given set of computing requirements. Students will demonstrate the ability

In this project students will design, implement, and evaluate a computing-based solution to meet a given set of computing requirements. Students will demonstrate the ability to create and manage processes and threads.They will create two processes, Producer and Consumer, using the C functions below:

void producer() {

int i;

while(1){

i = produce();

put(i);

}

}

void consumer() {

int i;

while(1){

i = get();

consume(i);

}

}

The Producer is simply creating numbers, which are passed to the Consumer in a static buffer. The students task is to implement the put() and get() functions. Each function will use a buffer (implemented as a word). The objective is to ensure that the producer is always ahead of the consumer and the consumer does not have to wait.

Deliverables:

  1. An explanation of your approach to implementation and its reasoning

You are allowed to use semaphores and mutexes for this assignment. Since the upcoming assignments will utilize these techniques, I think it would be good for us to use the "Producer and Consumer" algorithm to observe the capabilities of semaphores and mutexes to control thread interactions.

Also, I don't care what you name your functions for inserting or removing your Next_Item from your shared bounded Buffer, so you don't neet to worry about using the names "get()" or "put()" for your function.

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 Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

More Books

Students also viewed these Databases questions

Question

=+ Are some laws more important than others? If so, which ones?

Answered: 1 week ago

Question

=+j Describe how EU directives impact IHRM.

Answered: 1 week ago