Lock/Barriers Consider a cache-coherent multiprocessor.  Ass…

Lock/Barriers Consider a cache-coherent multiprocessor.  Assume the multiprocessor offers an atomic decrement operation on a shared variable.  You decide to provide a barrier synchronization primitive in your OS that is based on the following count-based algorithm:  int count = N; // initialized to the number of participating threads barrier()0. {1. decrement(count);2. if (count == 0)3. count = N;    // last processor to arrive 4. else5. while (count > 0);  // wait for last process 6. while (count!= N);//to not leave barrier before count reset7. } Identify any two race conditions that will lead to the algorithm not working as written above. 

Note: To complete this quiz: First work out the answers hand…

Note: To complete this quiz: First work out the answers handwritten on paper or handwritten on a tablet screen. This will be used for partial credit and as a back up if something goes wrong with your Internet connection. Second, enter your answers to the questions in the quiz. The Canvas quiz is your answer sheet for completing the questions. Third, in the last question of the quiz, you must upload a scan (pdf) of your handwritten work. If the quiz closes before you upload, you can use this link:Last Chance Upload for Showing Your Work    

Veronica absolutely loves skittles. It’s her favorite candy…

Veronica absolutely loves skittles. It’s her favorite candy in the whole wide world! However, Veronica knows skittles have a lot of sugar in them and her doctor recently told her she needs to cut back on sweets. Since Veronica knows she can’t imagine life without skittles, she has decided that instead of eating a full shareable size bag a day, she will work on decreasing her portion size. Use the following nutritional information for SKITTLES Original Fruit Candy Share Size Bag (4 oz) to answer the following question: How many grams of total sugar does Veronica consume if she chooses to eat half the bag instead?  Serving Size: 1 oz (28g/about 27 pieces) Servings Per Container: 4 Calories per serving: 110 Total Sugars per serving: 21 g