Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Operating systems
1. Operating Systems Team: Jonathan Arturo Alvarado Mata 1441616 Obed David Guevara Ibarra 1447478 Carlos Eduardo Triana Sarmiento 1412573 Blog: http://os-ocj.blogspot.com/
2.
3.
4.
5.
6. CONSUMER(){ while(1){ try to aquire the lock if(l1->TRYAQUIRE()){ if the array is empty, wait if it isn’t, continue... WHILE(ARRAY == FULL){ C->WAIT(L1); consume the next unit of data }decreae the number of items in the array CONSUME(int dummy); C-> SIGNALl(); Enables the waiting thread L1->RELEASE(); }end of if }end of while }//end of function consumer
7. void main(){ L1 = new lock(“L1”); C = new condition(“C”); Thread *t = new Thread(“producer”); t->Fork(producer, 1); Thread * t= new Thread(“consumer”); t->Fork(consumer, 1); }end main