-
Notifications
You must be signed in to change notification settings - Fork 0
makotora/multi-process-restaurant-simulation
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Yloipoihsa ola ta zitoymena tis ergasias. Opws protinetai stin askisi exw 4 ektelesima pu pernun tin simaia '-a appendfile' KAI tis shmaies pu anaferi i ekfwnisi. Simaia '-a appendfile': Prokite gia to onoma to APPEND ONLY ARXEIOY opoy grafoun ola ta programmata (ME SIGXRONISMO MESW SEMAFOROU IDIKA GIA TO APPEND FILE) Nai men to pernun ola ta ektelesima alla profanws arkei na dwthi sto ektelesimo 'restaurant' kai tha to metavivasi se ola ta alla programmata. <!>Yparxei makefile.Ena aplo make arkei gia to compile tou restaurant kai olwn twn ksexwristwn programmatwn. PARADEIGMA KLHSHS RESTAURANT: ./restaurant -n 20 -l bigbar -d 5 -a appendfile (DOYLEYEI kiolas ston fakelo iparxi afto to config file) I klisi twn allwn programmatwn ginete apo to restaurant me fork+exec opws protinete stin ekfwnisi To estiatorio dexete configuration file.Ena paradeigma config file einai to parakatw pu periexete (synolo 5) ston fakelo. tables 4 tableSizes 2 4 6 8 barSize 20 waiters 2 SIMANTIKO:O MAX_XRONOS pu variountai oi pelates ine DEFINED sto customer.c TA ORISMATA GIA TA ALLA EKTELESIMA (opws ta period gia tus xronus energias) ine hardcoded sto restaurant.c. Den theorisa aparaitito efoson the apaiteitai na ta valw sto config file gia na min poliplokefsw ta pragmata. Oi times ine Ok wste na fanei oti dulevun OLES OI LEITOYRGIES. Ta programmata kanun sleep() opws zitate apo tin ekfwnisi prosomoiwnontas ton xrono pu perni mia energeia. Leptomeries Ylopoihshs:(SIMANTIKO TO 4) 1)Gia tus servitorous moy (gia na ine ligo pio realistiko) ine ksexwristi energeia to 'analamvanw trapezi' apo to pernw paraggelia Dhladh oi servitoroi gia ena trapezi prwta tha to analavun (AN PROLAVUN PRWTOI) kai meta tha parun paragelia (kai telos tha dwsoyn logariasmo) 2)O doorman koitaei PANTA to bar efoson yparxoyn atoma se afto kai meta tin porta. PROKEIMENOY OMWS ena ksafniko adeiasma,na min odigisi sto na bi atomo apo tin porta anti gia atomo sto bar,krataei molis idopoieitai tin trexoysa katastasi trapeziwn kai stin sinexia koitaei (prwta sto bar kai meta stin porta) 3)Gia na ine ligo realistiko,enas pelatis 'customer' (ektelesimo) pote den asxoleitai me ta statistika tou estiatorioy,an kai the me diefkoline diladi DEN TO EKANA. Me ta statistika asxoluntai mono o doorman kai oi waiters. 4)Oson afora ta statistika,prosthesa kapoia epipleon apo afta pu anaferontai stin ekfwnisi: posoi exun bi sto bar (genika aneksartita an efigan), posoi plhrwsan k efigan,posoi efigan epidi itan gemato to estiatorio (den pigan kan sto bar), synolika esoda (pera apo ana trapezi pu iparxi ke afto) 5)Oi ergazomenoi (waiters doorman) perimenun (wait) ston semaforo tus gia kapoio post. Genika akolouthw tin arxi 1 post = 1 energeia gia afto pu apefthinete,diladi den koitane diarkws oi ergazomenoi ta trapezia h tin porta h ton bar,para mono an exun idopoihsh to kanun me sigxronismo kai epikoinwnia mesw tis kinis mnimis (me semaforous opu xriazete)
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published