This question is directly copied from University of Washington’s assignment. Ans is a
Which of the following program techniques and structures are "good" for a demand-paged environment?
- Stack - Good. Memory is allocated and data is accessed in a sequential pattern, so we good locality for prefetching.
- Hashed symbol table - Bad. Each access can potentially go to any allocated page of the table.
- Sequential search - Good. Again, memory accesses are sequential.
- Binary search - Bad. Accesses are all over the place.
- Pure code (read-only code) - Good. Since code usually has good locality, prefetching will work well.
- Vector operations - Good. Operating on a whole array at a time will have lots of sequential accesses (up each element of the array.
- Indirection - Bad. The locality of the pointers in the code is betrayed since what they point to can be anywhere.