Re: [試題] 102下 郭大維 作業系統 期中考 解答

作者: irritum (働いたら 負け)   2014-06-08 16:39:58
課程名稱︰作業系統
課程性質︰必修
課程教師︰郭大維
開課學院:電資學院
開課系所︰資工系
考試日期(年月日)︰2014/4/30
考試時限(分鐘):180
是否需發放獎勵金:是
(如未明確表示,則不予發放)
試題 :
The exam is 180 minutes long. The total score is 103pts. Please read the
questions carefully.
1.Terminologies (24pts).
a. Booting

Initialize all aspects of the system and then load and run the OS.

b. Interrupt Vector

An array of interrupt-handlers' addresses that are indexed by device
numbers (or interrupt numbers).

c. Cache Coherency

Cache coherency problems can arise when more than one processors refer
to the same data. Coherency defines what value is returned on a read.

d. Platform as a service (PaaS) in Cloud Computing

Pass provides a computing platform and a solution stack as a service,
such as a database server. One example is Microsoft Azure.

e. A Modular Kernel (Hint: OS Structure)

A moduler kernel consists of a set of components, where there are
core/primary modules, and it is of modules without a layer structure.

f. Data Parellelism in Multicore Programming

Distribute data over cores to execute the same operation.

g. Rate Monotonic Scheduling

A fixed priority real-time process scheduling algorithm in which the
priorities of processes are inversely proportional to their periods.

h. Deterministic Modeling

Take a particular predetermined workload and defines the performance
of each algorithm for that workload.

2. Please answer the following questions regarding the designs of operating
systems: (20pts)
a. There are two conflicting goals in the designs of operating systems.
What is the other one, beside "convenient for the users" ? (3pts)
b. Which one of the following actions/events is belonging to or might
result in software interrupts: System calls, child termination,
mouse clicking, invalid memory access. (8pts)
c. Consider the implementation of virtual machines in which operating
systems run on the top of the virtual machine software (or referred
to as the hypervisor). Is an operating system running in the user
mode or kernel mode? (3pts)
d. Please give me 2 advantages of virtual machines, beside system
consolidation and easy in system development/deployment. (6pts)

(a) Efficient operation of the computer system.
(b) System calls, child termination, and invalid memory access.
(c) The user mode.
(d) Complete isolation and multiple personalities.

3. ANSI C refers to the family of successive standards published by ANSI for
the C programming language. Please compare difference (or provide the
purpose difference) between POSIX and ANSI C. (5pts)

Any program written only in ANSI C and without any hardware dependent
assumptions is virtully guarnteed to compile correctly on any platform
with a conforming C implementation. POSIX is an acronym for "Portable
Operating System Interface". POSIX is for software compatibility with
variants of Unix and other operating systems.

4. Please answer the following questions for task scheduling. (14pts)
a. Is the "Swapper" a short-term or mid-term scheduler?
b. In Unix, the process control block PCB[] of a process consists of
proc[] and .u, where the attributes in .u are those needed when the
process is running, and the attributes in proc[] are those needed
all the time. Please indicate which one should be in .u : file[],
task priority, pid, signal disposition, and task state. You must
provide explanation to receive any credits. (10pts)

(a) It is a short-term scheduler.
(b) file[] and signal disposition.

5. Consider message passing and shared memory for inerprocess communication.
Is "Pipe" considered one for message passing or shared memory ? Is "Pipe"
direct or indirect communication ? Is it "synchronous" or "asynchronous" ?
for a reader or a writer of the communication in Unix. You must provide
explanation to receive any credits. (12pts)

It is "message passing" and indirect communication.
Reader: synchronous; Writer: asynchronous.

6. Kernel-level threads are superior than uer-level threads do in many ways.
What is the main disadvantage of kernel-level threads ? With OpenMP in
program development, shall we prefer kernel-level or user-level threads ?
You must provide explanation to receive any credits. (8pts)

It is context switching cost. With OpenMP, we should prefer
kernel-level threads because we look for parallelism to better utilize
multiple cores of a system.

7. Please answer the following questions for process scheduling. Explanation
is needed to receive any credits. (15pts)
a. Given 3 processes P1, P2, and P3 with CPU burst time 5, 6, 7,
respectively. Suppose that the 3 processes arrive at time 0, and P1
and P3 are the first and the last processes in the ready queue,
respectively. What is the average waiting time in running the 3
processes under the Round-Robin Scheduling with the time slice
equal to 3. (5pts)
b. Consider FCFS and Round-Robin Scheduling. If process are only of
CPU burst and all arrive at time 0, do FCFS and Round-Robin
Scheduling with time slice = 1 always have the same total waiting
time in running all processes ? Prove your answer. (5pts)
c. Suppose that the variance of the tunaround time is the cirterion in
process scheduling. Shall we have a small time slice for a better
variance turnaround time when all processes arrive at time 0? (5pts)

(a) (6 + (3 + 5) + (6 + 3)) / 3 = 23 / 3
(b) Nope.
Give one example, such as processes of CPU burst 7, 1, and 1.
(c) Yes.

8. Please explain why the Completely Fair Scheduling (CFS) of Linux V2.6
favors I/O tasks. (5pts)

An example answer: CFS usually dispatches the CPU to the task with the
smallest vruntime (that denotes how long the task runs) such that I/O
tasks usually have smaller vruntime.

Links booklink

Contact Us: admin [ a t ] ucptt.com