文档库 最新最全的文档下载
当前位置:文档库 › OS-exercise

OS-exercise

OS-exercise
OS-exercise

§1.True-False Questions: (Please answer with ╳or√)

( )1.Even on a single-user system, such as Windows or Mac, a user may be able to run only one program at one time.

( )2.Only one process can be in the state of running on any processor at any time.

( )3.Context-switch time is not overhead; the system still can do useful work while switching.

( )4.It is impossible for a child process to obtain resources that are not belong to its parent process.

( )5.When a child process is created, the parent process has to stop its execution and wait until the child process is terminated.

( )6.Even multiple processes are existed, the computation cannot be speeded up if there is only one processor.

( )7.In direct communication, there exists exactly one link between each pair of communicating processes.

( )8.In indirect communication, a link may be associated with many processes and each pair of processes may share several communication links.

( )9.There is at least one thread belongs to a running process.

( )10.Many-to-one model provides more concurrency than the one-to-one threading model.

( )11.All Java program comprise at least a single thread of control.

( )12.It is possible to suspend the execution of another Java thread within user created Java program.

( )13.All processes, either I/O-bound or CPU-bound, must perform I/O for meaningful execution.

( )14.Preemptive scheduling is complicated, but, fortunately, it does not incur a cost associated with coordination of access to shared data.

( )15.CPU scheduling deals with the problem of deciding which of the processes located in the hard disk is to be allocated the CPU.

( )16.FCFS is a kind of preemptive scheduling algorithm.

( )17.SJF is optimal – gives minimum average waiting time for a given set of processes ( )18.With multilevel queue scheduling, the RoundRobin should be used in the

foreground for the interactive processes.

( )19.Although multilevel feedback queue is the most general scheme, it is also the most complex one.

( )20.In asymmetric multiprocessing, each processor makes its own scheduling decisions, no master server is needed.

( )21.It is difficult to keep the dispatch latency low while implementing the soft real-time scheduling system.

( )22.To keep dispatch latency low, we need to allow system calls to be preemptible. ( )23.The JVM must specify whether threads are time-sliced or not, it is not

implementation dependent.

( )24.Deterministic modeling is simple and fast, but requires too much exact knowledge to be useful.

( )25.As CPU scheduling evaluation method, simulation is a more accurate than queueing model.

( )26.It is better to determine where the program will reside in memory before loading than making this decision until program execution.

( )27.The logical and physical addresses are the same in compile-time and load-time address binding but different in execution-time address binding.

( )28.With memory management unit (MMU), the user program never sees the real physical addresses.

( )29.With overlay, the system is able to keep all the necessary instructions and data in memory at all time.

( )30.If the binding is performed at assembly time, the program will be swapped back to the same location where the program was executed last time.

( )31.Multiprogramming is impossible in fixed-sized partition because each process may require different sized memory space.

( )32.It is possible for paging scheme to generate external fragmentation, while the internal fragmentation is inevitable.

( )33.Both associative registers and page tables can be searched simultaneously.

( )34. A bad page replacement choice increases the page-fault rate and slows process execution, but this will bot affect the correct execution of the processes.

( )35.The working-set window should be fixed within the execution of a particular program.

( )36.Disk bandwidth is defined as the total time between the first request and the completion of the last transfer.

( )37.SSTF scheduling is a form of SJF scheduling; may cause starvation of some requests.

( )38.In queuing theory, the probability function can tell us when the next customers will arrive.

( )39.Fixed routing and virtual routing ensures that messages form A to B will be delivered in the order in which they were sent. However, in dynamic routing,

messages may arrive out of order.

( )40. A router should be a dedicated, special-purpose device. A personal computer cannot serve this purpose.

( )41.If several sites transmit info over a link simultaneously, the info will become scrambled and must be discarded.

( )42.With Collision Detection is used in CSMA/CD, no collision may occur even when the system is busy.

( )43.In Token Passing, only one token is continuously circulating in the system. A site that wants to transmit info must wait until this token arrives.

( )44.Since OS is only software, the changes in the design of the hardware has no influence on it.

( )45.When a process executes, it typically executes for a long time before it either finishes or needs to perform I/O.

( )46.Random access memory (RAM) can only be accessed by CPU, no other device can directly communicate with it.

( )47.Being another kind of processor, device controllers cannot execute concurrently with the CPU.

( )48.The concept of cache memory can be applied only between CPU and memory in the storage device hierarchy.

( )49. A program is a passive entity and a process is an active entity with a program counter specifying the next instruction to execute.

( )50.The execution of a process is not necessarily to be sequential.

( )51.System calls should be made directly from C or C++, they usually cannot be called from low-level languages such as assembly.

( )52.In message-passing communication model, information is exchanged through an interprocess-communication facility provided by the operating system.

( )53.System research and development can be done on the virtual machine without disrupt normal system operation.

( )54.Message passing is useful when smaller numbers of data need to be exchanged. ( )55.With layered approach, an operating system can be debugged and verified without any concern for the lower layer.

( )56.Windows NT 4.0 partially redressed the performance problem of the first release of Windows NT by removing multiple layers into single integrated layer. ( )57.Not only the CPU, but also the resources such as file systems and line printers are also shared for the illusion of virtual machines.

( )58.The Java API is also included as a part of the Java virtual machine.

( )59.During system design, although mechanisms are strongly affecting policies, it is better to separate the policy from the mechanism.

( )60.Although an operating system today is overwhelmingly complex, it is still possible to have it implemented in assembly language.

( )61.Two processes associated with same program are considered the same separate execution sequences.

( )62.There are five states a process can be in, and only one process can be in running state at any instance.

( )63.The long-term scheduler selects which processes should be brought in to the ready queue.

( )64.Context-switch time is an overhead because the system cannot do useful work while switching.

( )65.The parent processes and the children processes created by the parent can be executed concurrently.

( )66.There will be no race condition when the instructions involved can be executed atomically.

( )67.When one thread is executing inside its critical section, all other threads should stop running and wait.

( )68.Without proper control, it is possible for two processes to be in their critical sections at the same time.

( )69.When solving critical section problems, we could make possible assumption concerning the relative speed of the threads.

( )70.The value of the lock returned by test-and-set instruction is the value before the instruction is applied on the lock.

( )71.Semaphores can be implemented as synchronization tool that does not require busy waiting.

( )72. A system built with semaphores cannot guarantee mutual exclusion.

( )73. A semaphore is always as powerful as a monitor and it always has value 0 or 1. ( )74.Although there are many readers working on the database with the startRead() and endRead() method, the semaphore db can be acquired (P operation) and

released (V operation) by the same reader.

( )75.With a semaphore, synchronization is already built-in, the programmer does not need to code the synchronization operations explicitly.

( )76.With a monitor mechanism, all the critical sections are located inside the monitor. ( )77.If concurrent processes call different entries in a monitor, the monitor forces them to be executed in sequence.

( )78.Successfully calling a synchronized method makes the lock of this object to be assigned to the calling thread.

( )79.When a thread calls notify() in an monitor, it must specify a thread in the wait set to be moved to the entry set.

( )80.Deadlock prevention differs from avoidance because deadlock avoidance make deadlock impossible.

( )81.If the processes in the system has no hold-and-wait condition, no deadlock can happen.

( )82.In order to prevent deadlock, there is no other ways except ensuring no cycle can happen in the resource allocation graph associated with this system.

( )83.It is impossible for a system with deadlock prevention scheme to become

deadlocked.

( )84.If a resource-allocation graph contains cycle, that means this system is deadlocked. ( )85.Releasing hold-and-wait condition for deadlock prevention is impractical in Java. ( )86.Although the operating systems today are very sophisticated, most of them has no deadlock manipulation schemes available.

( )https://www.wendangku.net/doc/764228930.html,ually deadlock recovery method should be invoked before deadlock detection. ( )88.The system will not become deadlocked even the system has reached an unsafe state.

( )89.Deadlock detection algorithm should be invoked only before the system is

deadlocked.

( )90.It is necessary to determine where the program will reside in memory when loading, otherwise the program will not be able to execute because it does not

know where to locate the program.

( )91.If the binding is performed at execution time, the program may be swapped back to the same location where the program was executed last time.

( )92.Multiprogramming is impossible in fixed-sized partition because each process may require different sized memory space.

( )93.Overlay can be used when the entering process is larger than amount of memory allocated to it.

( )94. A process must be completely idle before swapping, particularly with pending I/O. ( )95.

§2 Multiple Choices, Single Answ er Questions: (Please answer with capital letter(大

寫字母).)

( )96.Which of the following should not be contained in the stack of a process as temporary data?

(A) method parameters (B) return addresses (C) global variables (D) local

variables

( )97.Which of the following is not one of the information associated with a process in its process control block (PCB)?

(A) CPU registers (B) kernel (C) program counter (D) process state (E) I/O

status

( )98.There are many scheduling queues associated with the processes running in a system, which are job queue, _______ queue, and device queues. (A) ready queues (B)

I/O queues (C) port queues (D) routine queues

( )99.The selection of a process in the ready queue for entering the CPU for execution is called

(A) send (B) detach (C) transmit (D) dispatch

( )100.The selection of a process to bring into the ready queue is happening infrequently, therefore, the execution of the ______-term scheduler may be slow. (A) Short

(B) medium (C) long (D) immediate

( )101.When two processes wish to communicate, they need to establish a ____________ between them before they can exchange messages.

(A) communication link (B) bridge (C) channel (D) password

( )102.In NT, the message-passing between two processes that are on the same machine is called _______.

(A) LPC (B) PDC (C) GMP (D) LFM (E) PMC

( )103.Which of the following should not be shared between threads?

(A) Code section (B) register set (C) Data section (D) other resources ( )104.Which of the following should not be one of the multithreading models?

(A) Many-to-one model (B) One-to-many model (C) One-to-one model (D)

Many-to-many model

( )105.In a system that do not support multiple kernel threads, we should use the

_____________ model.

(A) Many-to-one (B) One-to-many (C) One-to-one (D) Many-to-many ( )106.Which of the following requires creating corresponding threads for its execution?

(A) user program (B) kernel (C) JVM (D) scheduler (E) All of the above ( )107.Process execution consists of a ______ of CPU execution and I/O wait.

(A) mix (B) cycle (C) introduction (D) non-stopping (E) equal-length ( )108.Which hardware is required for a platform to be capable of performing preemptive scheduling?

(A) Slots (B) Timer (C) Interrupt (D) Stack (E) Monitor

( )109.Dispatch latency is referring to the time it takes for the dispatcher to stop one

process and start running another. It should be as ______ as possible. (A) fast

(B) late (C) slow (D) steady (E) early

( )110.For the criteria of CPU scheduling, which of the following is matching the goal of CPU utilization, throughput, turnaround time, and waiting time, respectively.

(A) max, min, max, min (B) min, max, max, min (C) max, max, min, min

(D) min, min, max, max

( )111.FCFS scheduling has convoy effect because many ______ processes waiting for one ______ process to get off the CPU. (A) long, short (B) long, long (C)

short, long (D) short, short

( )112.SJF associates with each process the length of its next ______ to schedule the process.

(A) I/O interval (B) CPU burst (C) total process execution (D) program ( )113.SJF cannot be implemented at the level of _______-term CPU scheduling.

(A) short (B) long (C) medium (D) temporary

( )114.In Round Robin scheduling, each process gets a small unit of CPU time called ________..

(A) quantum (B) particle (C) ticket (D) module (E) context

( )115.Which scheduling allows processes to be moved between the various queues?

(A) RoundRobin (B) Multilevel queue (C) Multilevel feedback queue (D)

SJF (E) FCFS

( )116.Deterministic modeling takes a particular predetermined _______ and defines the performance of each algorithm for it. (A) time chart (B) workload (C)

size measure (D) name list

( )117.The linkage editor generates the load module which is sent to the _________ for generating the binary images.

(A) compiler (B) loader (C) binder (D) system library (E) memory

( )118.Dynamic loading (A) is useful for executing small size code. (B) is better for frequently needed program. (C) is loading the routine before it is needed.

(D) obtain a better memory space utilization.

( )119.In dynamic linking, linking postponed until execution time. A _________ is included in the image for each library-routine reference.

(A) function (B) image (C) stub (D) ticket (E) module

( )120.In fixed-sized partition, the degree of multiprogramming is directly related to the number of ________ in the memory.

(A) CPUs (B) printers (C) registers (D) variables (E) partitions

( )121.Suppose there are 40k, 50k, and 30k holes (in addressing sequence) left in the memory, which hole a 30k program will be allocated if first-fit, best-fit, and

worst fit is used? (following the sequence)

(A) 50k, 30k, 40k (B) 40k, 30k, 50k (C) 40k, 50k, 30k (D) 30k, 40k,

50k

( )122.Alghough page table cannot be searched simultaneously, it uses the _________ property to locate the frame number in corresponding table entry with one

memory access.

(A) ordering (B) numbering (C) indexing (D) normalized

( )123.In order to implement FIFO page replacement, a timer can be associated with each page or maintain a _______ to hold all pages in memory.

(A) binrary tree (B) linked list (C) pop-up stack (D) FIFO queue

( )124.If we use the recent past as an approximation of the near future, then we will replace the page that has not been used for the longest period of time. This is

_________ page replacement algorithm.

(A) LFU (B) LRU (C) optimal (D) FIFO (E) MFU

( )125.Second-chance algorithm (Clock Algorithm) is degenerated to _______ if all reference bits are set.

(A) FIFO (B) LRU (C) Optimal (D) Page buffering

( )126.Which of the following is a counting-based page replacement algorithm?

(A) OPT (B) LRU (C) LFU (D) clock

( )127.Working set strategy prevents thrasing while keeping the degree of

multiprocessing as _____ as possible.

(A) high (B) low (C) deep (D) short (E) long

( )128.Two major determining factors of disk access time is the seek time and the __________.

(A) around time (B) feedback time (C) rotational latancy (D) execution

time (E) wait time

( )129.Either SSTF or _________ is a reasonable choice for the default dsik

scheduling algorithm.

(A) SCAN (B) FCFS (C) LOOK (D) C-LOOK

( )130.Poisson arrival process: the interarrival times are distributed __________.

(A) exponentially (B) randomly (C) linerly (D) functionaly

( )131.In distributed operating system, if significant portions of the file are being accessed, it is more efficient to use ______________.

(A) data migration (B) computation migration (C) process migration (D)

network migration

( )132.The Internet today is grown from a four-site experiment network called _______ in 1986.

(A) Seednet (B) Arpanet (C) Eithernet (D) NSFnet

( )133.DNS distribute the names and addresses of all the other hosts among the systems on the network, it is like binding at (A) edit time (B) save time (C)

execution time (D) compile time (E) restore time

( )134.In ___________, temporary link is established dynamically for the duration of one message transfer.

(A) circuit switching (B) virtual switching (C) message swtiching (D)

packet switching

( )135.The technique that has been successfully used in the Ethernet system is __________.

(A) token passing (B) Message slot (C) CSMA/CD (D) Packet deliver

( )136.There are different techniques for avoiding repeated collision. If the loading of the network is not too high, which kind of technique below is more efficient?

(A) Collision Detection (B) Token Passing (C) Message Slots (D) None

of the above

( )137.There are four components comprise a computer system, including hardware, __________, application programs, and users.

(A) CPU (B) Windows (C) Hard disk (D) Operating Systems

( )138.In __________ systems, jobs with similar needs are grouped together before ran them through the computer for speeding up its processing.

(A) Concurrent (B) distributed (C) batched (D) multiprogrammed (E)

real-time

( )139.In multiprogrammed batch systems, several jobs are kept in main memory at the same time, and the CPU is _____________ among them.

(A) multiplexed (B) distributed (C) selecting (D) in-line (E) off-loaded ( )140.Which program loads the operating system into the memory?

(A) kernel (B) spooling (C) I/O (D) control (E) bootstrap

( )141.Operating system is ___________ driven.

(A) data (B) signal (C) message (D) interrupt (E) software

( )142.It is possible to overlap useful computation with I/O in ______________I/O.

(A) non-synchronous (B) synchronous (C) asynchronous (D)

semi-synchronous

Device controller transfers blocks of data from buffer storage directly to main

memory without CPU intervention is called

(A) Cycle stealing (B) Memory protection (C) Buffering (D) Direct

memory access

( )143. The only large storage media that the CPU can access directly is

(A) main memory (B) control storage (C) flash memory (D) hard disk

(E) associative memory

( )144. The instruction loaded into the instruction register of a CPU is (A) assembly instruction (B) compiled instruction (C) control storage

instruction (D) high-level instruction (E) machine-level instruction

( )145. After fetching the instruction, it is decoded by using its __________ to index

into the proper control storage instruction.

(A) status word (B) operand (C) op code (D) address (E) register

( )146. Memory-mapped I/O set aside ranges of memory addresses and mapped to

(A) device registers (B) cache memories (C) control storages (D) hard

disks ( )147. The _________ instructions can be issued only In the monitor mode of the

dual-mode operation.

(A) control (B) activated (C) privileged (D) prioritized

( )148. A distributed network is a collection of _________ connected through

communication lines.

(A) processors (B) memories (C) drivers (D) ports (E) slots

( )149. ________ is a new access method removing the need for a user to login before she is allowed to use a remote resource.

(A) answer (B) hang up (C) dial (D) WWW (E) wait

( )150. The greatest advantage by dividing operating system into layers is

(A) flexibility (B) convenience (C) effectiveness (D) modularity (E)

ease of control

( )151. A process includes its text section, ___________, program counter and stacks.

(A) data section (B) queue (C) memory (D) registers (E) variables ( )152. The context of a process is represented in the _______of a process.

(A) kernel (B) PCB (C) control storage (D) queue

( )153. The __________-term scheduler is used when the system has overcommitted

available memory, requiring memory to be freed up.

(A) long (B) medium (C) short (D) dynamic

( )154. section, it violates which requirement for a solution of critical section problem? (A) Progress (B) Mutual exclusion (C) Bounded waiting (D) Circular waiting ( )155. Hardware instructions can be used effectively in solving critical-section problem because they can be executed (A) efficiently (B) atomically (C) correctly (D) cooperatively ( )156. Consider the program for the remove() method of bounded-buffer problem on the right. Which instruction is missing from the

blank?

(a) empty.V() (b) mutex.V() (c) full.P() (d) empty.P()

( )157. A semaphore is an __________ that can only be accessed via two indivisible

operations: P and V . (A) condition variable (B) monitor variable (C) concurrent variable (D)

integer variable

( )158. What kind of problem can happen if more than one thread work on a semaphore in

the following sequence?

mutex.P();

criticalSection();

mutex.P();

(A) starvation (B) blocking (C) deadlock (D) not synchronizing (E)

violate mutual exclusion

( )159.The value of a _________ semaphore can range between 0 and 1.

(A) constant (B) binary (C) counting (D) fixed

( )160.A semaphore with busy waiting is also called a

(A) monitor (B) guard (C) deadlock (D) spinlock

( )161.When the value returned by the test-and-set instruction is ______, it means that the lock was previously occupied.

(A) true (B) false (C) 0 (D) 1 (E) null

( )162.notifyAll() removes ALL threads from the wait set and places them in the entry set.

This allows the threads to decide among themselves who should proceed next. It

is a _______ strategy.

(A) progressive (B) conservative (C) advanced (D) primitive

( )163.For protecting data that are accessed frequently but only in a read-only manner, readers-writers locks are more efficient than semaphores because semaphores

are accessed

(A) faster (B) slower (C) in sequence (D) concurrently

( )164.The entry set represents the set of ________ waiting for the lock to become available.

(A) processes (B) methods (C) blocks (D) threads (E) functions

( )165.In a monitor, ________ is built-in, the programmer not need to code the operations explicitly.

(A) concurrency (B) multiprogramming (C) synchronization (D) wait-for ( )166.In Java, the scope of the lock can be defined within the size of a

(A) method (B) procedure (C) block (D) message (E) entry set

( )167.Deadlock avoidance scheme requires that the system has some additional

_________ information available.

(A) detailed (B) structure (C) a priori (D) database

( )168.In Adaptive Mutex, if the lock is held by a thread that is currently running on another CPU, the thread

(A) spins (B) blocks (C) goes to sleep (D) switches out of the memory ( )169.Banker’s algorithm is a kind of

(A) Deadlock Recovery (B) Deadlock Avoidance (C) Deadlock

Detection (D) Deadlock Prevention

( )170.In dynamic linking, linking postponed until ________ time.

(A) compile (B) link (C) load (D) execution

( )171.When obtaining the wait-for graph form the resource-allocation graph, the nodes of type _________ is removed.

(A) resource (B) process (C) lock (D) request

( )172.If memory location is not known at compile time, the compiler must generate ________code.

(A) stub (B) absolute (C) relocatable (D) indexed

( )173.Which of the following strategies does not need to search the entire list of free holes before applying it?

(A) first fit (B) best fit (C) worst fit (D) better fit

( )174.The allocated memory may be slightly larger than requested memory; this size difference causes

(A) medium fragmentation (B) internal fragmentation (C) external

fragmentation (D) patched fragmentation

§3. Fill-in-the-blank Questions:

( )175.A process can be temporarily brought out of memory to a backing store, and then brought back into memory for continued execution. This is called

____________

1 5 ( )176. ________-fit and ________-fit better than worst-fit in terms of speed and storage

utilization.

( )177. It requires _______ memory accesses for every instruction access if the page

table is placed in main memory. ( )178. When referencing the memory, the ________________should be searched first

and the page table next.

( )179. It is important to keep the page-fault rate ________ in a demand-paging system.

( )180. OPT is difficult to implement since it requires ______ knowledge of the

reference string

( )181. Second-chance algorithm (Clock Algorithm) is based on _______ algorithm?

( )182. A page is busy swapping pages in and out is called ____________.

( )183. ________ algorithm is also called “elevator algorithm ”? ( )184. Queuing theory is the study of waiting in __________

( )185. In virtual routing, the path used to send a message is fixed for one __________.

§4. Short Answer Question: (54%)

( )186. The long-term scheduler controls the degree of multiprogramming (the number of

processes in memory). It is important that the long-term scheduler select a good

process mix of I/O-bound and CPU-bound processes to reach the best

performance. Discuss what will happen if : (1) all processes are I/O bound. (2) all

processes are CPU bound. And (3) no long-term scheduler exists.

( )187.

( )188. In the producer-consumer problem , the producer and consumer must be synchronized.

Specify how producer and consumer perform their operations collaboratively in

order to be synchronized.

( )189. Consider the bounded-buffer solution of the producer-consumer problem. Specify the

contents of the buffer after following sequence of calling the functions: enter(7),

enter(14), remove(), remove(), remove(), enter(13), enter(15), enter(10), remove()

in the space provided.

( )190.What are the differences between a process and a thread? Also, please explain the concept of user thread and kernel thread. Please also compare the process state

diagram with Java thread state diagram. Draw both diagram and explain the

differences.

SJF

RR

( )191.Consider the class

diagram shown on the

right. Complete the

corresponding program

by filling-in the blanks.

( )192.Queueing model

requires two kinds of

information: (1) the

distribution of CPU and

I/O bursts, (2)

arrival-time distribution.

Explain what these are

and how these

information can be used.

( )193.Suppose there are three processes entering the queue in the order specified below.

The arrival time and the next CPU burst time are provided below. Please calculate

the average waiting time if using FCFS , SJF (preemptive version), and

RoundRobin scheduling (with time quantum = 10). Y ou need to show the detail

of your calculation and complete the Gantt Chart below to demonstrate the

execution sequence.

( )194.Suppose the above processes are using a 3-level multilevel feedback queue. The

process dispatched from the first level queue (Q1) has 3 ms quantum size, second

level (Q2) has 5 ms and Q3 is FCFS. Also, P1 needs to do I/O for 2 ms at its 5ms

and 10ms execution time. Please finish the Gantt Chart provided below. (P1, P2,

and P3 each requires 15ms to complete.)

( )195.Suitable page sizes should be balanced between influencing

factors of internal fragmentation and page table sizes. Explain.

( )196.What is the most important characteristic

of an associtive register?

Explain why it can be done.

( )197.What are two main differences between a

W

AN and a LAN?

( )198.Consider following sequence of request

Q1(3ms)

Q2(5ms)

Q3

0 20 40 60 80 0 20 40 60 80 0 20 40 60

queue for disk I/O

35, 53, 92, 43, 15

With disk head originally at cylinder 40, draw the paths of head movement by

SSTF, SCAN and C-LOOK scheduling and find out their total head movement distances.

SSTF: SCAN:(current head direction: right)

C-LOOK: (reading direction:right)

( )199. Complete the logical address layout below showing a 32-bit machine with 16K

page size. Show the layout If two-level paging is used, with 8 bits for the outer

( ) ( ) (8) ( )

( )

( )200. Consider the paging scheme with associative registers on the right. Please fill-in the page table and the

associative registers with proper numbers.

( )201. Explain why SSTF scheduling tends to favor middle

cylinders over the innermost and outermost cylinders.

( )202. Evaluate FIFO and LRU page replacement algorithm by running it on the

memory reference string below and completing the tables provided. Compare the

number of page faults resulted.

Reference string: 5, 2, 0, 4, 2, 3, 4, 5, 2

( )263. There are 48 programmers per day (24 hours), in average, come in to use the

mainframe computer in the computing center. Each programmer uses the

computer for about 20 minutes. Use the equation provided to analyze the usage ( (

( λ

μρπρ

μρρ

ρ

ρμλρ-=-=-==-=)*10ln()90(11)/,(120q q q W L c C P

of the computer. You must explain the meaning of each equation.

( )264.What is an Operating System? Please briefly give its definition.

( )265.What are the differences between synchronous I/O and asynchronous I/O?

Explain the true meaning of synchronous as discussed in the class.

( )https://www.wendangku.net/doc/764228930.html,plete the Java compile-time and run-time environment on the

right.

( )267.Java is a programming language allowing cross-platform execution, however, it does not allow system calls to be made directly. Please

explain why and give the solution for that.

( )268.Give two reasons why caches are useful. What problems do they solve? What problems do they cause?

( )269.Although implementing an operating system in higher-level language has reduced speed and increased storage requirement, today’s OS still are

implemented in high-level languages. Why?

( )270.Please complete the state transition diagram

on the right.

( )271. Consider following C program with fork command and answer the following questions: (a) Which command cause the child process to be created? _________ (b) Is the parent and the child is executing same copy of the program? ______ (c) Is the parent and the child going through the same path of execution? ______ (d) What is the PID of the child process? _______ (e) Which process will be terminated first? _________

( )272.

Please draw diagrams of variables and functions to explain the functionality of "test_and_set" and "swap" hardware instructions.

( )273.

A solution to the critical-section problem must satisfy three requirements: ____________, ____________, ____________. ( )274.

The classical definition of P and V operation of semaphore is given below. Please fill-in the blanks provided for the new definition of P and V , which eliminated the problem of busy waiting. P(S) { V(S) { whi le S ≤ 0 S++; ; // no-op; } S--; } ( )275.

Apply Banker's Algorithm to the situation shown in the table below. Is the state

safe?(Y es/No ) ________

Give the sequence of completing the processes to

justify your answer: ______________________________

Give a situation where unsafe state is reached and give the example (please specify why) for all processes deadlocked.

Current Number of pages allocated Maximum Number of pages needed Process 1 4 10 Process 2 1 3 Process 3 2 5 Process 4 4 9

compile time

load time

execution time (run time) ( )276. Although spinlocks waist CPU time with busy waiting, they are still useful in

some systems. What are the advantage of spinlocks and in which situation they

are considered useful?

( )277. We can use an asymmetric solution for preventing deadlocks in

Dinning-Philosophers problem. Explain how.

( )278. of processing user programs.

相关文档