Question 51
MediumWhich kind of locality explains why a loop's instructions stay in memory?
- A.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Operating Systems
Which kind of locality explains why a loop's instructions stay in memory?
Network locality
Spatial locality
Sequential locality
Temporal locality
Sign up free to see the answer and a step-by-step explanation.
Which kind of locality explains why reading an array element by element benefits from caching?
Temporal locality
Spatial locality
Random locality
No locality
Sign up free to see the answer and a step-by-step explanation.
What is the effect of giving too few frames to each process in a busy system?
Fewer context switches
Less disk activity
Faster execution
Very high page-fault rates and thrashing
Sign up free to see the answer and a step-by-step explanation.
What does the 'valid–invalid' bit do in demand paging?
Marks whether a page is shared
Marks whether a page is currently in memory (and legal)
Marks whether a page has been modified
Marks the page size
Sign up free to see the answer and a step-by-step explanation.
Using LRU with 4 frames (initially empty), how many page faults occur for the reference string 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5?
Enter a number as the answer.
Sign up free to see the answer and a step-by-step explanation.
For the reference string 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5 under FIFO, how many page faults occur with 3 frames and with 4 frames?
9 with 3 frames, 10 with 4 frames
12 with both
9 with both
10 with 3 frames, 9 with 4 frames
Sign up free to see the answer and a step-by-step explanation.
What is copy-on-write?
A file is copied before it is opened
Pages are copied to every CPU's cache
Every write goes to disk immediately
Parent and child share pages after fork() until one of them writes, and only then is that page copied
Sign up free to see the answer and a step-by-step explanation.
How does the second-chance (clock) algorithm work?
It uses exact timestamps of every access
It replaces two pages at a time
It always replaces the newest page
Like FIFO, but a page whose reference bit is set gets its bit cleared and is skipped once
Sign up free to see the answer and a step-by-step explanation.
Memory access takes 200 ns and servicing a page fault takes 8 ms. To keep the slowdown below 10% (EAT < 220 ns), what must the page-fault rate p be below?
0.0001
0.001
0.01
About 0.0000025 (1 in 400,000)
Sign up free to see the answer and a step-by-step explanation.
What is the usual remedy when a system starts thrashing?
Use FIFO replacement
Reduce the degree of multiprogramming, for example by suspending some processes
Increase the time quantum
Add more processes
Sign up free to see the answer and a step-by-step explanation.