C programming work -- 2
S-au achitat serviciile după ce au fost prestate
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:
gcc producer.c -lrt -o producer
gcc consumer.c -lrt -o consumer
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.
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.
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.
ID Proiect: #37251917
Detalii despre proiect
19 freelanceri plasează o ofertă medie de 20500₹ pentru proiect
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 Mai multe
"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 Mai multe
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 Mai multe
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.
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 Mai multe
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 Mai multe
Hii there , I can build your project. let me know more information about the project. so i can start project
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 Mai multe
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 Mai multe
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 Mai multe
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 Mai multe
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 Mai multe
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 Mai multe
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 Mai multe
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 Mai multe
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 Mai multe
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.