Question: We modify the render-wnter problem to ar ioe nik problem At ice rek can alow 20 hockey players on the rink OR 50 repular skaters


We modify the render-wnter problem to ar ioe nik problem At ice rek can alow 20 hockey players on the rink OR 50 repular skaters on the nik. To ensure satefy. if there is a hockey playsr on the renk. there stould be ro segular skater os the fink. Ake, if there is a tegular skater on the fixk there should be no bedey player co the rimk. The following is the code for each bockey player process and each skaler process, bul t is incorplele You noed to add addifonal syncherization code to achieve the desirad correl as speofiad above. You are allowed to use two new semashores. "hayne' for the hockiyer prockss and 'asyne" for the sketer process. The abded spmehronizabion code can be the coutination of the fallewing statemeris You send to sad additional synchronzation code to achieve the desired control as specifed above. You are allowed to use two cent semachores. "hsyac" for the hackeyor process and "esyne" for the skater process. The bdded synchronization ocde can be the combiration of the following stadenenta A watitinge): k. witissyre]. signa(hsysec): D. eignatissynck (a) Gve the locason(s) and corresponding code(s) for the hockeyer process (b) Give the locason(s) and corresponding code(s) far the elatar pocasa Give your answers in the following exarpple folnat " AgCAD. H11B,H9CA", which means - Add cede "signabrsyroc); waititsync) signalissynel," between HB and H10 - Add code "Watissynch" betwen H10 and Hi2 - Add code "signatirenci: waitissyoci." afler H10 When you need to add code at multieie focations add for the earies locations frst and use a conme follobed by a space as the seperatoe (a) Give the infalizaton velues for the somaphores used in the previotrs gumston - Intialzadicin valuo for sorot: - Intabeution value Aor hpeot - Intialzetion valuo for fink - Intialzation valiat for ssyno: - Intideation valuo for hsync (b) Assuen thet the mink is Fowr ocouped by 20 hockey players 19 skators and 10 hockey ployors are watry to ender the nri. What is the current cotinser value of nach sattakere? * Currem ocinter vilue of sprat - Curieni countior value of isret - Curient osunter vidue of mink - Curiemi oounter vadue of ssync. - Current counter value of hilise (c) Which somaphore has the maxima number of processes (fockeyers and diavers) woting in its ouece? Jirt give the narne of the semaphore that apply
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
