操作系统考试卷子-期中2005-11-1
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Test For Operating System
No. Name
一Fill the blank presented below with appropriate words(1x30 points)
1. The most common multiple-processor systems now use__________, in which each processor runs an identical copy of the___________, some systems use___________, in which each processor is assigned a specific task.
2.Real-time system come in two flavors: ___________ and___________.
3.There are two common models of communication: _____________and
_____________.
4.Sever systems can be broadly categorized as _________ and_________.
5.Each process may be in one of the following states: new、_______
_______、________、terminated.
6.System calls provide the interface between_______ and _______.
7.________________selects process from the pool and loads them into memory for execution . __________________selects from among the process that are ready to execute and alloctes the CPU to them.
8.The operating system must provide a mechanism for process_________
and_________
9.Supprot for threads may be provided at either the user level, for_____________ , or by the kernel, for_____________.
10.There are four main CPU scheduling algorithms: FCFS、________、RR and______
11.A solution to the critical-section problem must satisfy the following three requirements:____________、____________、_____________.
12.A deadlock situation can arise if the following four conditions hold simultaneously in a system: mutual exclusion、____________、_____________and circular wait 13.Many systems provide support for both user and kernel threads, resulting in different multithreading models. There are three main models:______________、______________、________________.
二single-choice(1x20)
1. The goal of a time-sharing operating system pursue is ( )
A. response immediately
B. multi-thread
C. velocity
D. parallel execute
2.Multiprocessos system have three main advatages, except ( )
五道口生活网
A. Increased throughtput
B. Economy of scale
C. Increased reliability
D. Reduce the complexity of OS
3.Which operating system have rigid time requirements( )
A. Batch mode OS
B. Multiprogrammed batch OS
C. Time-shared OS
D. Real-time OS
4.Which one is not the advantages of distributed system? ( )
A. Resource sharing
B. Reliability
C. Not a real-time system
D. Communications
5.Which one is not the way to enter kernel mode from user mode? ( )
A. A special instruction called a supervise or call
B. Traps mechanism
C. Interrupts mechanism
D. Procedure call
6. Which task is not performed by an operating system? ( )
A. Process management
B. Memory management
C. File management
D. Language management
7.The system services provided below, which one is not provided for user, but for ensuring the efficient operation of the system itself ( )
A. Program execution
B. Communications:
C. Error detection
D. Resource allocation
8.A PCB contains many pieces of information associated with a specific process, which one is not contained( )
A. Process state
B. Program counter
C. Fault information
D. CPU register
9.The interval from the time of submission of a process to the time of completion is the ( )
A. Turanaround time
B. Waiting time
C. Response time
五道口生活网
D. Context-switch time
10.Which one is not the criteria of CPU schedule( )
A. CPU utilization
B. Throughput
C. Turnaround time
D. Increased reliability
11.Which one is not the reason that we provide an environment that allows process cooperation( )
A. Information sharing
B. Computation speedup
C. Modularity
D. Response immediately
12.A semaphore S ,initialize to 2 and current value is -1,then how many processes is waiting( )
A.0
B.1
C.2
D.3
13.Which CPU schedule algorithm may lead to the starvation problem( )
A. First-Come, First-Served
B. Shortest-Job-First
C. Round-Robin
14.Which one below is not the benefits of multithreaded program ( )
A. Increase reliability
B. Responsiveness
C. Resource sharing
D. Economy
15.Which solution is used in UNIX to deal with the deadlock problem ( )
A. Use a protocol to prevent deadlock, ensuring that the system will never enter a deadlock state.
B. Allow the system to enter a deadlock state, detect it, and recover.
C. Ignore the problem altogether, and pretend that deadlock never occur in the system.
D.both A and B
16.Bankers Algorithm is used to deal with the ( )
A. starvation problem
B. process communication
C. Deadlock problem
D. Process synchronization problem
17.Which one is not the classic problem of Synchronization ( )
A. The Bounded-Buffer problem
B. The Readers-Writers Problem
五道口生活网
C. The Ding-Philosophers Problem
D. The Starvation Problem
18.There are three concurrent processes in the system, each of them require four instances of the same type resource, then how many instances are needed at least to avoid deadlock( )
A.9
B.10
C.11
D.12
19.A critic section is( )
A. a segment of data
B. a segment of code
C. buffers
D. I/O devices
20.Which one is high-level synchronization construct( )
A. monitor
B. semaphore
C. synchronization hardware
D. binary semaphore
三Answer the questions in the space provided below each question.
e the semaphore Full、empty and mutex to solve the bounded-buffer problem(5 points)
2.Consider the following set of processes, with the length of the CPU-burst time given in millionseconds :
Process Burst Time Priority
P1 10 3
P2 1 1
P3 2 3
P4 1 4
P5 5 2
The processes are assumed to have arrived in the order P1, P2, P3, P4, P5 all at time 0.
a.Draw two Gantt charts illustrating the execution of these processes using FCFS, a
nonpreemptive priority (a smaller priority number implies a higher priority) scheduling. (5 points)
五道口生活网
b.What is turnaround time of each process for RR (quantum=1) scheduling. (5
points)
c.What is the waiting time of each process for SJF scheduling.(5 points)
3.Conside the following snapshot of a system:
Allocation Max Available
A B C D A B C D A B C D
P0 0 0 1 2 0 0 1 2 1 5 2 0
P1 1 0 0 0 1 7 5 0
P2 1 3 5 4 2 3 5 6
P3 0 6 3 2 0 6 5 2
P4 0 0 1 4 0 6 5 6
Answer the following questions using the bankers algorithm:
a.What is the content of the matrix Need?(5 points)
b.Is the system in a safe state? If not, explain why. If the system is in a safe state ,
then write all the safe sequences(5points)
c.If a request from process P1 arrives for (0,4,2,0), can the request be granted
immediately?(5 points)
五道口生活网
4. The sets P、R、and E of a resource-allocation graph are shown as follows P={P1、P2、P3}
R={R1、R2、R3、R4}
E={P1→R1、P2→R3、R1→P2、R2→P2、R2→P1、R3→P3、P3→R2、R4→P3} Resource instances:
One instance of resource type R1
Two instance of resource type R2
One instance of resource type R3
Three instance of resource type R4
a.Drawn the resource-allocation graph(5 points)
b.Is the system in s safe state or not? explain why.(5 points)
5.write some methods that can be used to solve the Dining-Philosophers Problem (describe these methods just in nature language) (5 points)
五道口生活网
五道口生活网。