• 沒有找到結果。

作業系統

N/A
N/A
Protected

Academic year: 2021

Share "作業系統"

Copied!
3
0
0

加載中.... (立即查看全文)

全文

(1)

國立臺中教育大學九十七學年度研究所碩士班

(含在職進修專班)招生考試

作業系統試題

適用學系:資訊科學學系

※ 共 10 題,每題 10 分

1. Describe the purpose of the command interpreter. Why is it usually separate from the kernel?

2. Describe the meaning of swapping.

3. What is the definition of a socket? What’s its representation? Show the figure of communication using sockets.

4. In a computer system, a physical memory reference takes 200 nanoseconds. The paging system has its page table stored in memory. We add translation look-aside buffer (TLB) to reduce the overhead of page-table access. If TLB access takes 10 nanoseconds and 80 percent of all page-table references are found in the TLB, what is the effective paged memory reference time?

5. How many page faults would occur for the following page reference string if the virtual memory management system uses the LRU replacement algorithm? Assume there are four page frames and all frames are initially empty.

Page reference string: 1,3,4,2,6,5,1,2,1,3,6,3,7,2,1,2,6,3,4,6,5,4,2

6. A disk drive has 200 cylinders, numbered from 0 to 199. Suppose that it is currently serving a request at cylinder 150 and the previous request was at cylinder 130. The queue of pending requests, in FIFO order, is 82, 113, 25, 48, 140, 189, 29, 77. What is the total distance (in cylinders) that the disk arm moves to serve all the pending requests if adopting the SCAN disk scheduling algorithm?

7. Consider the following processes:

Process Arrival Time Burst Time Priority Value

P1 0 6 2

P2 1 4 1

P3 4 2 3

P4 7 3 4

(a)Suppose we are using a preemptive priority scheduler (high priority value for high priority).

(2)

(a.1)Write the execution order of these processes. (a.2)What is the average waiting time?

(b) Now suppose we are using a preemptive Shortest-Job-First scheduler. (Please ignore the priority value).

(b.1)Write the execution order of these processes. (b.2)What is the average waiting time?

8. The Readers-Writers Problem with semaphore

The readers-writers problem has several solutions. The simplest one requires that no reader will be kept waiting unless a writer has already obtained permission to use the shared data. In other words, no reader should wait for other readers to finish simply because a writer is waiting. In this solution, the reader processes share the following data structures:

semaphore mutex, wrt; int readcount;

The semaphores mutex and wrt are initialized to 1; readcount is initialized to 0. The semaphore wrt is common to both reader and writer processes.

The code for a writer process is shown in Figure 1; the code for a reader process is shown in Figure 2. Please fill code in the Block-A, Block-B, Block-C, Block-D and Block-E. (2 points for each Block)

Black-A Black-A Black-B Black-C Black-E Black-D Black-B Black-C Black-E Black-D

(3)

9. Please describe the Necessary Conditions of occurring process deadlock?

10. There are 4 types of resources (A, B, C and D resource) with many instances respectively in a system. Consider the following snapshot of a system:

Allocation Max Available

A B C D A B C D A B C D P0 6 2 0 3 6 2 0 5 5 0 1 2 P1 0 4 0 1 6 6 0 5 P2 0 2 0 1 0 2 0 1 P3 3 4 1 5 3 6 2 5 P4 0 0 1 0 7 0 1 5

Answer the following questions using the banker's algorithm: (a) What is the content of the matrix Need? (3 points)

(b) Is the system in a safe state? Please describe the reason. (3 points)

(c) If a request from process P1 arrives for (3, 0, 0, 1), can the request be granted immediately? Please describe the reason. (4 points)

數據

Figure 1 The structure of a writer process Figure 2 The structure of a reader process

參考文獻

相關文件

(2)Ask each group to turn to different page and discuss the picture of that page.. (3)Give groups a topic, such as weather, idols,

On the course content page, click the function module to switch to different learning activities pages for learning; you can also directly click the "learning activity" in

As students have to sketch and compare graphs of various types of functions including trigonometric functions in Learning Objective 9.1 of the Compulsory Part, it is natural to

The PE curriculum contributes greatly to enabling our students to lead a healthy lifestyle with an interest and active participation in physical and aesthetic

These strategies include hands-on and minds-on exploratory activities that allow students to integrate and apply knowledge and skills, sustain their interests in science

In Hong Kong, our young people’s understanding of the importance of the Basic Law as the constitutional document of the Hong Kong Special Administrative Region (HKSAR),

It provides details about promoting Language across the Curriculum at the secondary level, the learning and teaching of language arts and the four language skills, namely

• If there are many challenges and few supports, the text is probably best for storytelling or reading aloud.. • If there are more challenges than supports, the text is probably