Uploaded by rpr.rr.19

Sample questions on exam

advertisement
Sample questions and problems for Operating Systems exam
1. Two terms “data consistency” and “data coherence” were applied to multi-node computer
systems both in Lesson 18 (for DFS - distributed file systems) and in 19 (for SMS - shared
memory systems) with the same meaning in Russian as “согласованность или
непротиворечивость данных”. (Usual definition of both “consistent data” and “coherent
data” is “The data sets having the same state, or values”.) Popular dictionaries like Google
give us the same Russian equivalents. However, in English these two terms have slightly
different meanings. What is difference between these two English terms?
A hint: try to explain why the term “consistency” was not used when describing one more
multi-node system: SMP – symmetrical multiprocessing, while “coherence” was.
2. The best visual description of a thread scheduling process is the state-transition diagram of
a thread. In our lecture course materials, you can see two versions of this diagram for Linux:
in Lesson 11, section 3 and in Deitel’s tutorial, page 954, Fig. 20.2. Please compare them.
Evidently, they are not adequate to each other both in graphics and in essential details. This
is because different authors use different visual notations and prefer to detail different
features. A generalized diagram is shown in Tanenbaum’s tutorial (in Russian): стр. 119,
рис. 2.2, where “Действие” = “Running” in our terms. Please study it and related text and
answer the following questions:
A) What of four possible transitions matches preemption, i.e. is not possible with nonpreemptive scheduling?
B) What transition can initiate the process itself? (While all others are initiated by OS.)
C) How many processes can change their scheduling states at once as a result of CPU
scheduling actions after an interrupt? Select the proper answer from the following three:

Only one process

One or several processes

Always more than one process change their states
3. Is it possible to read current value of the semaphore variable S in the application program?
4. Single-processor system executes two independent processes concurrently. Each process
is waiting for input-output for 70% of the time in average. What is CPU load level? – That is,
what is average percentage of the time when the CPU is in use? (A hint: use Probability
theory approach.)
5. Several threads are running in Round Robin mode with 10 ms time slices. How many thread
context switches do occur per second at least?
6. Explain common points and differences between the fork and clone system calls in Linux
7. Write pseudo codes of two concurrent threads with barrier synchronization in a certain point:
each thread must stop at that point, wait until another thread reaches its barrier point and
then continue execution. Use binary semaphores (don’t forget to initialize them).
8. Let the execution time of every machine instruction is t, and the time of page fault
processing (i.e., of loading a new page) is T >> t.
A) Write formula for effective (i.e., average) execution time of machine instruction Tmean,
if page fault occurs every k instructions in average
B) Apply that formula to the case: t = 1 ns, T = 10 ms; k = 107.
9. A CPU with 32-bit memory address supports two-level page memory: 32-bit virtual address
is divided on 9-bit directory index field, 9-bit page table index field and 14-bit displacement:
Answer to the following questions with decimal numbers (or approximately, with decimal
order of magnitude, if the number is too big):
a) How big is the page size in bytes (or KB, MB) ?______________________________
b) What is maximum page table size - how many elements may be in it ?______________
c) How many page tables at most can a process have ?____________________________
d) How many pages are there in the virtual address
space ?__________________________
Quiz. Put × into box with the proper answer:
1) Process interrupt can happen:
1. At any time moment………..……………………………………..………………
2. Only just after execution of any machine instruction……………………………
3. Only just after execution of an instruction from a limited set of instructions…..
2) What parameters limit virtual address space size of a process? Parameters of:
1. The processor architecture………..
2. The computer configuration……..…
3. The Operating System………….…
Download