A monitor is a construct designed to ensure mutual exclusion. It uses the concept of a thread being “inside” or “outside” to do this.
Blog
Explain how linear ordering prevents deadlock.
Explain how linear ordering prevents deadlock.
Which of the following are stored in a PCB (processor contro…
Which of the following are stored in a PCB (processor control block)?
In MLF, it is possible for a process’s laxity to be a negati…
In MLF, it is possible for a process’s laxity to be a negative number.
The PURPOSE is the environment check and to make sure your …
The PURPOSE is the environment check and to make sure your equipment is working. The quiz questions make sure you understand that. I expect you to take this EXACTLY like you would take an exam. YOU NEED TO READ ALL THE FOLLOWING AND WATCH THE VIDEO SO YOU KNOW WHAT TO DO WHEN YOU START THIS QUIZ. Before Every Exam. . . 1. Reliable computer (laptop or desktop) Use the device that you will use to take your real exam. If you change devices during the semester, take the Equipment Set-up and Environment Check Quiz again (as many times as you want) to make sure everything is configured properly. A Chromebook will not run Lockdown Browser. You need to borrow a computer or (preferably) get a laptop from the LSC TechConnect program 2. Suspend Automatic Updates if you’re on a Windows 10 computer Automatic updates in Windows 10 can disrupt your ability to use Lockdown Browser. Practice disabling it now before you take your Practice “Exam” Follow these instructions Once you complete the steps, your device will no longer receive updates of any kind until the day you specified. When your device reaches the pause limit, you must allow Windows 10 to download and install the latest updates to make the option available again. If you want to undo the changes (do this after taking each Exam) Use the same instructions, but on step No. 5, choose the Select date option OR click the Resume updates button from the Windows Update settings page 3. Webcam and microphone The webcam and mic can be separated or built into the computer. If you purchase a webcam, make sure it has a mic. 4. Reliable internet access. How to (potentially) make your WiFi faster 5. A quiet place with a desk or table to take your exam. Do not sit on your bed. You will download Respondus LockDown Browser through Brightspace (D2L) when you open the quiz. Read this general info (download & and read the student guide): Respondus LockDown Browser & Monitor Info Watch this video explaining LockDown Browser generally so you know what to expect. MANDATORY for everyone to watch How to perform an environment check Environment check
Is the following pseudocode correct or incorrect? If it is c…
Is the following pseudocode correct or incorrect? If it is correct, explain how it correctly enforces mutual exclusion. If it is incorrect, explain why. while (!exit) { /* LENGTHY EVENT PROCESSING CODE GOES HERE */ int currEvents = totalEvents; enterMutualExclusion(); // Assume this works { totalEvents = currEvents + 1; } exitMutualExclusion(); // Assume this works}
Do processes have a “dead” state? Fully explain why or why n…
Do processes have a “dead” state? Fully explain why or why not. Do threads have a “dead” state? Fully explain why or why not.
Do you think the hybrid model of threading has all of the ad…
Do you think the hybrid model of threading has all of the advantages of both kernel and user, or are there disadvantages to the hybrid model that don’t apply to the other two? Fully explain your answer.
Name and explain two pieces of information tracked in a PCB…
Name and explain two pieces of information tracked in a PCB (process control block).
Below is the pseudocode of the first two versions of Dekker’…
Below is the pseudocode of the first two versions of Dekker’s algorithm. Explain the problem with the first that is corrected by the second and how the second corrects this problem. Note: The code of the threads (after the first global lines) will be written TWICE for each version. The first time, the code of the two threads are side-by-side to make it easier to compare them. But in case this does not show up properly on your screen, the code will be written again with T2’s code written AFTER T1’s. VERSION 1:int threadNumber = 1;startThreads();*** SIDE-BY-SIDE ***// T1: // T2:while (!done) { while (!done) { // non-critical code goes here // non-critical code goes here while (threadNumber == 2) ; // spin while (threadNumber == 1) ; // spin // this line marks entering mutual exclusion // this line marks entering mutual exclusion // critical section code is here // critical section code is here threadNumber = 2; // exiting mutual exclusion threadNumber = 1; // exiting mutual exclusion // more non-critical code goes here // more non-critical code goes here} }*** TOP AND BOTTOM ***// T1:while (!done) { // non-critical code goes here while (threadNumber == 2) ; // spin // this line marks entering mutual exclusion // critical section code is here threadNumber = 2; // exiting mutual exclusion // more non-critical code goes here} // T2:while (!done) { // non-critical code goes here while (threadNumber == 1) ; // spin // this line marks entering mutual exclusion // critical section code is here threadNumber = 1; // exiting mutual exclusion // more non-critical code goes here}VERSION 2:boolean t1Inside = false;boolean t2Inside = false;startThreads();*** SIDE-BY-SIDE ***// T1: // T2:while (!done) { while (!done) { while (t2Inside) ; // spin while (t1Inside) ; // spin t1Inside = true; // this line marks t2Inside = true; // this line marks // entering mutual exclusion // entering mutual exclusion // critical section code is here // critical section code is here t1Inside = false; // exiting mutual exclusion t2Inside = false; // exiting mutual exclusion // more non-critical code goes here // more non-critical code goes here} }*** TOP AND BOTTOM ***// T1:while (!done) { while (t2Inside) ; // spin t1Inside = true; // this line marks // entering mutual exclusion // critical section code is here t1Inside = false; // exiting mutual exclusion // more non-critical code goes here}// T2:while (!done) { while (t1Inside) ; // spin t2Inside = true; // this line marks // entering mutual exclusion // critical section code is here t2Inside = false; // exiting mutual exclusion // more non-critical code goes here} }