0% found this document useful (0 votes)
19 views5 pages

Exercise 4

The document contains a series of true/false questions and multiple-choice questions related to computer systems concepts such as deadlocks, memory management, and process scheduling. It covers topics like the banker's algorithm, fragmentation, and methods for eliminating deadlocks. Additionally, it includes practical scenarios for evaluating resource allocation and deadlock conditions.

Uploaded by

zhangyunzhen005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views5 pages

Exercise 4

The document contains a series of true/false questions and multiple-choice questions related to computer systems concepts such as deadlocks, memory management, and process scheduling. It covers topics like the banker's algorithm, fragmentation, and methods for eliminating deadlocks. Additionally, it includes practical scenarios for evaluating resource allocation and deadlock conditions.

Uploaded by

zhangyunzhen005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

(True/False) The circular-wait condition for a deadlock implies the hold-and-wait


condition.

2. (True/False) The banker's algorithm is useful in a system with multiple instances


of each resource type.

3. (True/False) Fragmentation does not occur in a paging system.

4. (True/False) Hashed page tables are particularly useful for processes with sparse
address spaces.

5. In an asymmetric solution for the dining philosophers problem, deadlock is


avoided, because
A) there is no contention for acquiring chopsticks.
B) neighboring philosophers will never get hungry at the same time.
C) any neighboring philosophers would have already acquired one of their chopsticks
before attempting to acquire the shared chopstick.
D) a philosopher will release a chopstick if he is unable to acquire the other chopstick.

6. One necessary condition for deadlock is ______, which states that there is a chain of
waiting processes whereby P0 is waiting for a resource held by P1, P1 is waiting for a
resource held by P2, and Pn is waiting for a resource held by P0.
A) hold and wait
B) mutual exclusion
C) circular wait
D) no preemption
7. Deadlocks can be prevented only if
A) all four necessary conditions cannot hold.
B) at least one of the four necessary conditions cannot hold.
C) mutual exclusion condition cannot hold.
D) circular wait condition cannot hold.

8. Which of the following is not a factor in choosing which process to terminate during
recovery from a deadlock?
A) How many more resources the process needs in order to complete.
B) How many processes will need to be terminated.
C) What the priority of the process is
D) Who the parent of the process is.

9. If the starting address location changes, in which of the following cases, the
program has to be recompiled?
A) Execution time binding.
B) Load time binding.
C) Compile time binding
D) Both compile and load time bindings.

10. Suppose the size of a process is 10,000 bytes and the relocation register is loaded
with value 5000, which of the following memory address this process can access?
A) logical address 10,350
B) physical address 4,500
C) physical address 10,350
D) None of the above
11. Given the logical address 0xAEF9 (in hexadecimal) with a page size of 256 bytes,
what is the page number?
A) 0xF9
B) 0xAE
C) 0xA
D) 0x00F9

12. A frame table stores


A) which frames are allocated.
B) which frames are free.
C) total number of frames.
D) All of the above.

13. A page-table base register stores


A) a pointer to the page table in memory.
B) the starting logical address of the page currently being accessed.
C) the starting physical address of the frame currently being addressed.
D) the page size of the page currently being accessed.

14. A large page size results in


A) lower internal fragmentation
B) larger page table overhead
C) efficient disk I/O
D) All of the above
15. Describe two methods for eliminating deadlock by aborting a process.

16. Suppose that there are two resource types (R1 and R2) with five resources each
available to four processes. At time 0, the following data is collected. The table
indicates the process, the number of resources of each type currently allocated to the
processes, and the current request of each resource type by each process.
Process Allocation Request
R1 R2 R1 R2
P0 2 0 3 2
P1 1 1 1 0
P2 0 1 1 1
P3 1 1 3 2
Is there a deadlock? Please explain why.

17. How is a limit register used for protecting main memory?


18. Distinguish between internal and external fragmentation.

19. Describe the elements of a hashed page table.

20. What is the context switch time, associated with swapping, if a disk drive with a
transfer rate of 2 MB/s is used to swap out part of a process that is 200 KB in size?
Assume that no seeks are necessary and that the average latency is 15 ms. The time
should reflect only the amount of time necessary to swap out the process.

You might also like