Find Jobs
Hire Freelancers

producer and consumer problem using multi-threads, mutex lock and semaphores.

$10-30 USD

In Progress
Posted over 3 years ago

$10-30 USD

Paid on delivery
C program utilizing multi-threads, mutex lock, and semaphores for the producer and consumer problem. Define an integer buffer with the size of 32 and implement a circular queue data structure that is used by producers and a consumer. Next, you will need to initialize the mutex lock and semaphores. Here, you will use two semaphores where one indicates a full queue and the other indicates an empty queue. The producer function is used to insert a random number between 0 and 10 to the queue. The consumer function is used to remove a number from the queue in a FIFO fashion. In addition, inside the loops of the producer and consumer functions, add a random delay between 0 and 2 seconds to simulate various lengths of processes. In addition, you are required to use 2 producers and 1 consumer for this project where 0 and 2 are producers and 1 is consumer (3 threads). Finally, code should run forever. where the number is the thread identifier, the second number is the random number inserted to or removed from the queue, and the third number is the queue index. Also, print out a message when the buffer is full or empty. Code should run in UNIX server. Expected results should be similar to one in file provided.
Project ID: 26837377

About the project

5 proposals
Remote project
Active 4 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Hello, I just saw your offer. I believe that I have adequate knowledge and experience to build an exclusive c++ application. With me you'll gain guaranteed quality work for your application. I have immense experience in creating high performant, hyperthreaded and multitasking applications. I have worked in cplusplus on projects related to databases, parallel pipelining, compilers,distributed systems and trading software. I have done multiples projects on producer consumer problem so i am pretty sure that i will be able to complete it If the above offer sounds like something you would be interested in, I’d love to hear from you. Looking forward to hearing from you
$30 USD in 2 days
5.0 (2 reviews)
1.2
1.2
5 freelancers are bidding on average $52 USD for this job
User Avatar
HI..I am proficient in C/C++ programming with multiple POSIX threads along with synchronisation using mutex locks, semaphores and can help you write the producer and consumer program.
$80 USD in 1 day
4.9 (212 reviews)
6.5
6.5
User Avatar
Hi, There. I have plenty of experience in C, Concurrent programming. Have a chat about the project. I shall be glad to help you with this project.
$80 USD in 2 days
5.0 (14 reviews)
4.0
4.0
User Avatar
Hi... I have already completed projects upon semaphore and mutex locks hence confident enough to complete your project within 2 working days time. Ping me to discuss further
$40 USD in 2 days
0.0 (0 reviews)
0.0
0.0
User Avatar
I'm an Electronic Engineering undergraduate and have completed the Real Time Operating Systems course last semester, where I got to work with exact same problems. I've already written similar code so I think I can deliver your content in just 24 hours time. Let's get started!
$30 USD in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
Warrensburg, United States
0.0
0
Member since Aug 5, 2020

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.