Which of the following statements are CORRECT?
(A) A process always checks the state of the currently executing process to enter its critical section.
(B) Spin locks use busy waiting.
(C) Periodically testing a variable until some value appears is known as busy waiting.
(D) A critical region/section is the part of a program where shared memory (a shared resource) is accessed.
(E) A printer daemon continuously checks to see if there are any files to be printed.
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: C. (B) and (D) only
Explanation
A spin lock makes a waiting process sit in a tight loop re-testing a lock variable, so (B) is true by definition. A critical section is the part of a process's code that accesses a shared resource, so (D) is true. (A) is wrong because a process entering a critical section checks a shared lock/semaphore variable, not the 'state' of whichever process happens to be running. (C) is wrong because true busy-waiting means continuously (not periodically) re-testing the variable in a spin loop; periodic checking at intervals describes polling, a different, less CPU-wasteful technique. (E) is wrong because a print spooler is driven by its job queue and interrupts, not by continuous polling, which is the whole point of spooling.More Computer System Architecture questions
- At a particular time of computation, the value of a counting semaphore is 7. Then 20 P operations and 'x' V operations were performed on th…
- Match List I with List II: List I: (A) Critical region (B) Wait/Signal (C) Working set (D) Deadlock List II: (I) Hoare's monitor (II) Mutua…
- At a particular time of computation, the value of a counting semaphore is 7. Then 20 P operations and 'x' V operations were performed on th…
- In the design protocol of the critical section problem, each process must ask permission to enter the critical section in …… code; it then…
- Consider a system with five processes P0 through P4 and three resource types A, B and C, with 7, 2 and 6 total instances respectively. At t…
- The Bounded Buffer problem is also known as the ________.