






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of the baci programming language, a simplified version of c++ used for concurrency programming at university of central florida. It covers the basics of writing and compiling baci programs, using semaphores, and the producer-consumer model. The document also includes instructions for installing baci and examples of producer and consumer code, as well as test cases and submission instructions.
Typology: Study Guides, Projects, Research
1 / 10
This page cannot be seen from the preview
Don't miss anything!







void print_number(int i){ cout<<i<<endl; } main(){ cobegin { University of Central Florida { print_number(1); print_number(2); print_number(3); } }
semaphore s = 17;
p(s); - v(s);
binarysem b = 0;
p(b); - v(b);
Size of 20
produce one by one, once an item has been produced, it is available to consumer immediatelyavailable to consumer immediately
void producer(int NullLoop, int NumberOfItems){ ……for (i=0;i<NullLoop;i++) {} …… // produce items one by one// for every item produced, print it out// cout << "producer enter a new item " << total << ", value: " << value << endl; …. } void consumer(int NullLoop, int ConsumerID){ ……for (i=0;i<NullLoop;i++) {}cout << "consumer " << ConsumerID << " remove an item " << value << endl;…… }
If you work on your own computer, upload it to olympus
You will need new Makefile - cp /export/home/e/emontagn/project/Makefile3 Makefile - make submitcc
Nov 26 (Monday) midnight