Skip to content

This is an exercise on the producer/consumer problem using System V IPC

Notifications You must be signed in to change notification settings

AhmadSameh/producer-consumer_problem_sysV_IPC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

System V IPC Exercise

This is an exercise on the producer/consumer problem using System V IPC

The producer:

To run the producer, use the following arguments.
./producer {COMMODITY_NAME} {MEAN} {STD_DEV} {SLEEP_INTERVAL} {BUF_SIZE}
e.g.
./producer NATURALGAS 7.1 0.5 200 40 would run a producer that declares:
1- The current price of Natural Gas
2- Is to be declared every 200ms
3- The change is according to a normal distribution with parameters (mean=0.5 and variance=0.25).
4- The size of the shared bounded buffer is 40 entries.

The Consumer:

The consumer simply prints the price of each commodity with the text color changing with the price and it takes the size of its buffer as argument.
It should be something like this: image

The Results:

This terminal is called terminology, used to split the screen into multiplte terminals to easily access each running terminal.
This is an example of running 11 different producer processes and 1 consumer process, all of which are accessing the same memory. image

About

This is an exercise on the producer/consumer problem using System V IPC

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published