Producer-Consumer processes

This program should create two concurrent processes that will communicate between themselves with the help of shared memory and semaphores. The processes will be a producer and a consumer. The producer will produce items (e.g. integer numbers) and place them on a buffer (a queue perhaps?), which will exist on the shared memory. The consumer will remove items from the buffer and "consume" them. The queue will have a maximum capacity of 10 items. Fork should be used to create the two processes. (parent process: producer, child process: consumer) The shared memory should be created with shmget and will be deleted with shmdt. Also for the shared memory part, the following commands should be used: shmop, shmat, shmctl, ipcrm, ipcs) Semaphores will be used for the synchronization of the two processes (the commands sema_init, sema_destroy, sema_wait, sema_trywait and sema_post should be used). In the attached .zip file there is a .pdf that might help with some of the commands that should be used and a sample code file that roughly shows how the code should look like.

## Deliverables

Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. Complete copyrights to all work purchased.

## Platform

It should compile on gcc and run in linux

## Deadline information

Ofcourse when the buffer is full, the procducer should suspend itself and thus give time to the consumer in order to consume the items on the buffer. If the buffer is empty, the consumer should suspend itself and give time to the producer to produce more items. In order to work on this project one must be familiar with the term "critical section" and its significance in a process. Therefore the following rules should be kept in order for the program to function properly: [url removed, login to view] two processes must never be in critical sections at the same time. 2.A process that is not in a critical section will not be allowed to suspend the other process. [url removed, login to view] maximum time that a process has to wait before entering a critical section must be defined.

Habilidades: Programação C, Engenharia, Linux, MySQL, PHP, Arquitetura de software, Teste de Software, UNIX

Veja mais: look for producer, linux programming pdf, how to be a producer, c++ programming commands, c programming commands, concurrent programming, 0 1 integer programming, producer consumer shared memory linux, processes, look for some numbers in pdf, integer programming, gcc, buffer source code, linux create zip file, linux compile program, order synchronization, pdf memory, linux semaphores, semaphores linux, semaphores shared memory

Acerca do Empregador:
( 4 comentários ) Greece

ID do Projeto: #2855197

Concedido a:


See private message.

$21.25 USD em 14 dias
(13 Comentários)

2 freelancers estão ofertando em média $21 para esse trabalho


See private message.

$21.25 USD in 14 dias
(139 Comentários)