C programming work -- 2

Closed Posted 2 months ago Paid on delivery
Closed Paid on delivery

File Structure:

You will work with the provided producer_template.c and consumer_template.c source files. Rename them to producer.c and consumer.c after writing your code.

Do not modify the low-level functions for reading from and writing to shared memory; use the provided functions.


Compile your programs using the following commands:

Copy code

gcc producer.c -lrt -o producer

gcc consumer.c -lrt -o consumer

Producer Program:

Accept three command-line arguments as integers:

bufSize: Size of the bounded buffer (2 to 500).

itemCnt: Number of items to produce/consume (greater than 0).

randSeed: Seed for the random number generator.

Create a shared memory block with a fixed size of 4K, named OS_HW1_yourName.

Initialize the shared memory block's header with:



in: Index of the next item to be produced

out: Index of the next item to be consumed

Fork a child process and load the consumer executable into it.

Use the Producer() function to generate random integers (5 to 2500) and write them into the bounded buffer. If the buffer is full, wait until the consumer consumes an item.

Consumer Program:

Open and map the shared memory block created by the producer, named OS_HW1_yourName.

Read the four integer values from the header.

Read all the items written by the producer to the shared memory buffer (itemCnt). If the buffer is empty, wait until the producer produces more items.

Coding Guidelines:

Follow the provided pseudo-code for bounded-buffer producer/consumer.

Use provided functions for reading and writing shared variables.

Utilize the GetRand() function for generating random numbers.

C Programming Java C# Programming Software Architecture C++ Programming

Project ID: #37251917

About the project

19 proposals Remote project Active 1 mo ago

19 freelancers are bidding on average ₹20500 for this job


Hi, I have great experience in both C and C++ programming and software development for the Linux platform. I have lots of experience in multi threaded programming and multi processing and working with thread and More

₹12500 INR in 2 days
(59 Reviews)

"Hello, my name is Dervis and I am a highly experienced C programmer with many years of experience in the field of C programming. I understand that you are looking for someone to develop a C program that can produce ra More

₹35000 INR in 7 days
(2 Reviews)

HI,I can deliver you the work within hours as I have many projects similar to this one on my plate. I understand the need for speed in this project and will work hard to complete it as soon as possible. My skillset inc More

₹15000 INR in 7 days
(7 Reviews)

I am an experienced C/C++ developer. I have 3 years of experience in Linux system programming and the POSIX standard. Your task is easy to me. I believe I can help you in this task. Thank you.

₹22000 INR in 4 days
(1 Review)

Hello there! My name is Leonard and I'm an embedded systems engineer specializing in robotics and application automation. I see that you're looking for someone to help with your project creating a C programming workboo More

₹25000 INR in 7 days
(2 Reviews)

Dear, sir. I have just read your requirement and very interested in your C/C++ project. I have 10+ years experience in Software Development and the C/C++ is my top skill. As for rich experience, Network Connection Pro More

₹12500 INR in 1 day
(1 Review)

Hii there , I can build your project. let me know more information about the project. so i can start project

₹25000 INR in 7 days
(0 Reviews)

Hello, I am a student from Serbia. I have great experience in C programming and in creating programs with multiple threads and working with fork() system call. I recently passed my operating systems class and I have ve More

₹12500 INR in 3 days
(0 Reviews)

Hello client, I am a c programmer and developer for 2-3 years of experience. I can done this project very quickly. I understand that you want some experimental project. I have a team of 20 members. An More

₹20000 INR in 4 days
(0 Reviews)

Hello there! My name is Anshavee and I am a C Programming freelancer with 1 years of experience helping clients. I understand that you are looking for someone to work on your C programming work - specifically file stru More

₹12500 INR in 3 days
(0 Reviews)

Hii, I would like to take the initiative to create an advance project. I will make sure this visually looks good, professional and most importantly meet your brand guidelines. Here are the process which is very simple More

₹25000 INR in 7 days
(0 Reviews)

Hello. I read your description carefully. As C/C++ developer with 15+ years experience, I am very interested in your project and am sure that I can make perfect result than others. I am very familiar with C and C++ a More

₹12500 INR in 7 days
(0 Reviews)

Hi. I read the assignment requirements carefully. I am interested in working on such assignments. I have strong background on memory management in C and C++ and also developed similar projects during my bachelor studie More

₹16000 INR in 7 days
(0 Reviews)

I appreciate your detailed requirements for the producer and consumer programs and understand the importance of adhering to specific guidelines for this task. Rest assured, I am well-equipped to handle this project. F More

₹24000 INR in 5 days
(0 Reviews)

I am an experienced system programmer on Linux based platforms. I have a background in memory related work and am familiar with the tools to debug any issues and optimize further. I fully understand your requirement fo More

₹20000 INR in 7 days
(0 Reviews)

Hi Greetings! We are team of software developers. We have developers working on almost all the technologies. We will assign you a project manager who will assist you during entire process of project completion. We wil More

₹37500 INR in 7 days
(0 Reviews)

Hello! I will perfectly complete your C programming work, based on my strong C/C++/C# Programming experience in 1 day. Please open the chat with me so that I can start working for you. Regards.

₹12500 INR in 1 day
(0 Reviews)