Em Andamento

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

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.

Habilidades: Programação C, Arquitetura de software, Algoritmo, UNIX

Veja mais: producer-consumer problem in c using pthreads/bounded-buffer/semaphore, producer consumer problem using semaphores in c, producer consumer problem in os pdf, producer consumer problem c, producer consumer problem using threads in c, producer consumer problem in c using semaphores and shared memory, multiple producer-consumer problem in c, example of producer consumer problem in os, producer consumer problem using fork, producer consumer problem using semaphores, solving producer consumer problem using semaphores, program producer consumer problem using unix, producer consumer problem using concurrent programming, write code producer consumer problem using semaphores, producer consumer problem using semaphores threads, producer consumer problem using, producer consumer problem using monitors unix, producer consumer problem in c using semaphores and threads, producer consumer problem using semaphore in linux, producer consumer problem in c using queue

Acerca do Empregador:
( 0 comentários ) Warrensburg, United States

ID do Projeto: #26837377

Concedido a:

hk395a

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 i Mais

$30 USD em 2 dias
(2 Comentários)
1.2

5 freelancers are bidding on average $52 for this job

koustav2006

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 em 1 dia
(212 Comentários)
6.5
yashkatta1

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 dias
(14 Comentários)
4.0
DataSoolutions

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 dias
(0 Comentários)
0.0
kasuneranda

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 deli Mais

$30 USD em 1 dia
(0 Comentários)
0.0