


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Main points of this past exam are: Preventing Deadlock, Sentence Definition, Atomic, Deadlock, Disk Cylinder, Doubly Indirect, Contiguous Allocation, Linked Allocation, Single-Level Index, Unix Multi-Level Index
Typology: Exams
1 / 4
This page cannot be seen from the preview
Don't miss anything!



General Information: This is a closed book examination. You have 60 minutes to answer as many question as possible. The number in parentheses at the beginning of each question indicates the number of points given to the question; there are 60 points in all. Write all of your answers directly on this paper. Make your anwers as concise as possible (you needn't cover every available nano-acre with writing).
For each of the following statements, indicate in one sentence whether the statement is true or false, and why.
(a) Binary semaphores are those that are used by no more than two threads.
Answer: False, binary semahpores contain two states 0 or 1.
(b) The Banker's algorithm is a way of preventing deadlock
Answer: True, no process is allowed into a section if deadlock is possible.
(c) A multi-level indexed file permits faster random access than a contiguously allocated file.
Answer: False, contiguous files may be easily jumped through, while the multi-level file must seek right blocks.
For each of the following items, write a sentence definition:
(a) Atomic
Answer: An atomic function or command cannot be interrupted in between.
(b) Deadlock
Answer: A state where all threads are waiting for a resource held by another and nothing can therefore finish.
(c) Disk cylinder
Answer: The same track on all platters in a disk pack.
(d) Doubly indirect block
Answer: A block of pointers to blocks of pointers which in turn point to file blocks.
CS162, Spring/1992 Midterm #2 Professor Thomas Anderson 1
A thread can be in one of thre states: ready to run, running, or blocked. For each transition indicated below, identify under what circumstances it occurs:
(a) ready -> running
Answer: Another thread is blocked, finishes, or yields to this thread.
(b) running -> ready
Answer: Thread yields to another
(c) running -> blocked
Answer: Thread has to wait on condition or lock.
(d) blocked -> ready
Answer: Thread is signaled or lock is released. Condition is met.
The Demos system employs a clever block group indexed scheme for file allocation on disk. State the principle advantage of this scheme compared to each of the following, and justify your answer:
(a) contiguous allocation
Answer: Easier to increase size, allocate another block.
(b) linked allocation
Answer: Easier to access randomly, use indexes
(c) a single-level index
Answer: Easier to handle big files, use BIGFILE condition and indirect block.
(d) a UNIX multi-level index
Answer: Fewer seeks, use bitmap.
(a)
(b)
Answer:
void answerBegin() { speak.acquire;
Problem #3 (8 points) 2
Posted by HKN (Electrical Engineering and Computer Science Honor Society)University of California at BerkeleyIf yo 4