Final -Summer 2016-Operating System – Solutions
Download file with the answers
Final -Summer 2016-Operating System - Solutions
1 file(s) 1.37 MB
Not a member!
Create a FREE account here to get access and download this file with answers
03-60-330-01 Final Examination Wednesday, August 17th, 2016
SCHOOL OF COMPUTER SCIENCE
OPERATING SYSTEM CONCEPTS (03-60-330-01)
FINAL EXAMINATION
TEST ID # 01 Duration: 03 hours
Student ID:
FIRST Name:
LAST Name:
Instructions:
1) This is a closed-book examination – NO notes or books or slides may be used.
2) Do not copy from other students or communicate in any way. All questions will be answered only by
the attending proctors.
3) Do not remove any papers from this booklet or add new ones. You may not remove any staples
holding this exam together.
4) You may not use any reference material(s) except what has been provided within this examination
booklet.
5) The examination must be surrendered immediately when the instructor announces the end of the
test period.
6) Each student must sign the examination exit list before leaving the classroom.
“I have neither given nor received unauthorized help with this examination. Any suspicion of cheating
will automatically void my mark on this examination”
________________________________________________________________________
(Signature)
Unsigned examination booklets will not be graded.
Signature implies agreement with the above statement in quotes.
________________________ ________________________ _________________________
(First Name) (Last Name) (Student ID)
2015 IS 2 of 20 03-60-330-01 Final Examination
Part I (100 marks) – Multiple Choice Questions
All questions are Multiple Choice or True/False. In each Multiple Choice question, you are to choose only
one response which best answers the question. Use the Scantron sheet provided to indicate your answers.
If an error is made you must carefully erase the error and then fill in the circle you intend to choose. USE
PENCIL ONLY ON THE SCANTRON SHEET
1. The surface of a magnetic disk platter is divided into ____.
A) sectors
B) arms
C) tracks
D) cylinders
2. Suppose we have the following page accesses: 1 2 3 4 2 3 4 1 2 1 1 3 1 4 and that there are three frames
within our system. Using the FIFO replacement algorithm, what is the number of page faults for the given
reference string?
A) 14
B) 8
C) 13
D) 10
3. The _____ binding scheme facilitates swapping.
A) interrupt time
B) load time
C) assembly time
D) execution time
4. A deadlocked state occurs whenever ____.
A) a process is waiting for I/O to a device that does not exist
B) the system has no available free resources
C) every process in a set is waiting for an event that can only be caused by another process in the set
D) a process is unable to release its request for a resource after use
5. Which of the following is true of nonpreemptive scheduling?
A) It requires a timer.
B) A process keeps the CPU until it releases the CPU either by terminating or by switching to the waiting
state.
C) It incurs a cost associated with access to shared data.
D) A process switches from the running state to the ready state when an interrupt occurs.
________________________ ________________________ _________________________
(First Name) (Last Name) (Student ID)
2015 IS 3 of 20 03-60-330-01 Final Examination
6. The first readers-writers problem ____.
A) requires that, once a writer is ready, that writer performs its write as soon as possible.
B) is not used to test synchronization primitives.
C) requires that no reader will be kept waiting unless a writer has already obtained permission to use the
shared database.
D) requires that no reader will be kept waiting unless a reader has already obtained permission to use the
shared database.
7. The _____ model maps many user-level threads to one kernel thread.
A) many-to-many
B) two-level
C) one-to-one
D) many-to-one
8. A _________________ saves the state of the currently running process and restores the state of the next
process to run.
A) save-and-restore
B) state switch
C) context switch
D) none of the above
9. A microkernel is a kernel ____.
A) containing many components that are optimized to reduce resident memory size
B) that is compressed before loading in order to reduce its resident memory size
C) that is compiled to produce the smallest size possible when stored to disk
D) that is stripped of all nonessential components
10. Which of the following would lead you to believe that a given system is an SMP-type system?
[SMP = symmetric multi-processing]
A) Each processor is assigned a specific task.
B) There is a boss–worker relationship between the processors.
C) Each processor performs all tasks within the operating system.
D) None of the above
11. On media that uses constant linear velocity, the ____.
A) disk’s rotation speed increases as the head moves towards the middle of the disk from either side
B) disk’s rotation speed remains constant
C) density of bits decreases from the inner tracks to the outer tracks
D) density of bits per track is uniform
________________________ ________________________ _________________________
(First Name) (Last Name) (Student ID)
2015 IS 4 of 20 03-60-330-01 Final Examination
12. Suppose we have the following page accesses: 1 2 3 4 2 3 4 1 2 1 1 3 1 4 and that there are three
frames within our system. Using the FIFO replacement algorithm, what will be the final configuration of
the three frames following the execution of the given reference string?
A) 4, 1, 3
B) 3, 1, 4
C) 4, 2, 3
D) 3, 4, 2
13. The roll out, roll in variant of swapping is used ____.
A) when a backing store is not necessary
B) for the round-robin scheduling algorithm
C) for priority-based scheduling algorithms
D) when the load on the system has temporarily been reduced
14. One necessary condition for deadlock is ____, which states that at least one resource must be held in
a nonsharable mode.
A) hold and wait
B) mutual exclusion
C) circular wait
D) no preemption
15. ____ is the number of processes that are completed per time unit.
A) CPU utilization
B) Response time
C) Turnaround time
D) Throughput
16. What is the correct order of operations for protecting a critical section using a binary semaphore?
A) release() followed by acquire()
B) acquire() followed by release()
C) wait() followed by signal()
D) signal() followed by wait()
17. The _____ model maps each user-level thread to one kernel thread.
A) many-to-many
B) two-level
C) one-to-one
D) many-to-one
________________________ ________________________ _________________________
(First Name) (Last Name) (Student ID)
2015 IS 5 of 20 03-60-330-01 Final Examination
18. A process may transition to the Ready state by which of the following actions?
A) Completion of an I/O event
B) Awaiting its turn on the CPU
C) Newly-admitted process
D) All of the above
19. _____ provide(s) an interface to the services provided by an operating system.
A) Shared memory
B) System calls
C) Simulators
D) Communication
20. A ____ can be used to prevent a user program from never returning control to the operating system.
A) portal
B) program counter
C) firewall
D) timer
21. The SSTF scheduling algorithm ____.
A) services the request with the maximum seek time
B) services the request with the minimum seek time
C) chooses to service the request furthest from the current head position
D) None of the above
22. Suppose we have the following page accesses: 1 2 3 4 2 3 4 1 2 1 1 3 1 4 and that there are three
frames within our system. Using the LRU replacement algorithm, what is the number of page faults for
the given reference string?
A) 14
B) 13
C) 8
D) 10
23. _____ is the dynamic storage-allocation algorithm which results in the smallest leftover hole in
memory.
A) First fit
B) Best fit
C) Worst fit
D) None of the above
________________________ ________________________ _________________________
(First Name) (Last Name) (Student ID)
2015 IS 6 of 20 03-60-330-01 Final Examination
24. One necessary condition for deadlock is ______, which states that a process must be holding one
resource and waiting to acquire additional resources.
A) hold and wait
B) mutual exclusion
C) circular wait
D) no preemption
25. ____ scheduling is approximated by predicting the next CPU burst with an exponential average of
the measured lengths of previous CPU bursts.
A) Multilevel queue
B) RR
C) FCFS
D) SJF
26. A solution to the critical section problem does not have to satisfy which of the following
requirements?
A) mutual exclusion
B) progress
C) atomicity
D) bounded waiting
27. The _____ model allows a user-level thread to be bound to one kernel thread.
A) many-to-many
B) two-level
C) one-to-one
D) many-to-one
28. In a(n) ____ temporary queue, the sender must always block until the recipient receives the message.
A) zero capacity
B) variable capacity
C) bounded capacity
D) unbounded capacity
29. _____ is not one of the major categories of system calls.
A) Process control
B) Communications
C) Protection
D) Security
________________________ ________________________ _________________________
(First Name) (Last Name) (Student ID)
2015 IS 7 of 20 03-60-330-01 Final Examination
30. Embedded computers typically run on a ____ operating system.
A) real-time
B) Windows XP
C) network
D) clustered
31. Consider a disk queue holding requests to the following cylinders in the listed order: 116, 22, 3, 11,
75, 185, 100, 87. Using the SCAN scheduling algorithm, what is the order that the requests are serviced,
assuming the disk head is at cylinder 88 and moving upward through the cylinders?
A) 116 – 22 – 3 – 11 – 75 – 185 – 100 – 87
B) 100 – 116 – 185 – 87 – 75 – 22 – 11 – 3
C) 87 – 75 – 100 – 116 – 185 – 22 – 11 – 3
D) 100 – 116 – 185 – 3 – 11 – 22 – 75 – 87
32. Given the reference string of page accesses: 1 2 3 4 2 3 4 1 2 1 1 3 1 4 and a system with three page
frames, what is the final configuration of the three frames after the LRU algorithm is applied?
A) 1, 3, 4
B) 3, 1, 4
C) 4, 1, 2
D) 1, 2, 3
33. _____ is the dynamic storage-allocation algorithm which results in the largest leftover hole in
memory.
A) First fit
B) Best fit
C) Worst fit
D) None of the above
34. One necessary condition for deadlock is ______, which states that a resource can be released only
voluntarily by the process holding the resource.
A) hold and wait
B) mutual exclusion
C) circular wait
D) no preemption
35. The ____ scheduling algorithm is designed especially for time-sharing systems.
A) SJF
B) FCFS
C) RR
D) Multilevel queue
________________________ ________________________ _________________________
(First Name) (Last Name) (Student ID)
2015 IS 8 of 20 03-60-330-01 Final Examination
36. A(n) _______ refers to where a process is accessing/updating shared data.
A) critical section
B) entry section
C) mutex
D) test-and-set
37. A _____ uses an existing thread — rather than creating a new one — to complete a task.
A) lightweight process
B) thread pool
C) scheduler activation
D) asynchronous procedure call
38. A blocking send() and blocking receive() is known as a(n) _________________
A) synchronized message
B) rendezvous
C) blocked message
D) asynchronous message
39. _____ allow operating system services to be loaded dynamically.
A) Virtual machines
B) Modules
C) File systems
D) Graphical user interfaces
40. A clustered system ____.
A) gathers together multiple CPUs to accomplish computational work
B) is an operating system that provides file sharing across a network
C) is used when rigid time requirements are present
D) can only operate one application at a time
41. Consider a disk queue holding requests to the following cylinders in the listed order: 116, 22, 3, 11,
75, 185, 100, 87. Using the FCFS scheduling algorithm, what is the order that the requests are serviced,
assuming the disk head is at cylinder 88 and moving upward through the cylinders?
A) 116 – 22 – 3 – 11 – 75 – 185 – 100 – 87
B) 100 – 116 – 185 – 87 – 75 – 22 – 11 – 3
C) 87 – 75 – 100 – 116 – 185 – 22 – 11 – 3
D) 100 – 116 – 185 – 3 – 11 – 22 – 75 – 87
________________________ ________________________ _________________________
(First Name) (Last Name) (Student ID)
2015 IS 9 of 20 03-60-330-01 Final Examination
42. Belady’s anomaly states that ____.
A) giving more memory to a process will improve its performance
B) as the number of allocated frames increases, the page-fault rate may decrease for all page replacement
algorithms
C) for some page replacement algorithms, the page-fault rate may decrease as the number of allocated
frames increases
D) for some page replacement algorithms, the page-fault rate may increase as the number of allocated
frames increases
43. Which of the following is true of compaction?
A) It can be done at assembly, load, or execution time.
B) It is used to solve the problem of internal fragmentation.
C) It cannot shuffle memory contents.
D) It is possible only if relocation is dynamic and done at execution time.
44. One necessary condition for deadlock is ______, which states that there is a chain of waiting
processes whereby P0 is waiting for a resource held by P1, P1 is waiting for a resource held by P2, and Pn
is waiting for a resource held by P0.
A) hold and wait
B) mutual exclusion
C) circular wait
D) no preemption
45. Which of the following scheduling algorithms must be nonpreemptive?
A) SJF
B) RR
C) FCFS
D) priority algorithms
46. _____ can be used to prevent busy waiting when implementing a semaphore.
A) Spinlocks
B) Waiting queues
C) Mutex lock
D) Allowing the wait() operation to succeed
47. _________ involves distributing tasks across multiple computing cores.
A) Concurrency
B) Task parallelism
C) Data parallelism
D) Parallelism
________________________ ________________________ _________________________
(First Name) (Last Name) (Student ID)
2015 IS 10 of 20 03-60-330-01 Final Examination
48. Which of the following statements is true?
A) Shared memory is typically faster than message passing.
B) Message passing is typically faster than shared memory.
C) Message passing is most useful for exchanging large amounts of data.
D) Shared memory is far more common in operating systems than message passing.
49. Microkernels use _____ for communication.
A) message passing
B) shared memory
C) system calls
D) virtualization
50. Which of the following is a property of peer-to-peer systems?
A) Clients and servers are not distinguished from one another.
B) Separate machines act as either the client of the server but not both.
C) They do not offer any advantages over traditional client-server systems.
D) They suffer from the server acting as the bottleneck in performance.
51. Consider a disk queue holding requests to the following cylinders in the listed order: 116, 22, 3, 11,
75, 185, 100, 87. Using the SSTF scheduling algorithm, what is the order that the requests are serviced,
assuming the disk head is at cylinder 88 and moving upward through the cylinders?
A) 116 – 22 – 3 – 11 – 75 – 185 – 100 – 87
B) 100 – 116 – 185 – 87 – 75 – 22 – 11 – 3
C) 87 – 75 – 100 – 116 – 185 – 22 – 11 – 3
D) 100 – 116 – 185 – 3 – 11 – 22 – 75 – 87
52. Optimal page replacement ____.
A) is the page-replacement algorithm most often implemented
B) is used mostly for comparison with other page-replacement schemes
C) can suffer from Belady’s anomaly
D) requires that the system keep track of previously used pages
53. A(n) ____ page table has one page entry for each real page (or frame) of memory.
A) inverted
B) clustered
C) forward-mapped
D) virtual
________________________ ________________________ _________________________
(First Name) (Last Name) (Student ID)
2015 IS 11 of 20 03-60-330-01 Final Examination
54. In a system resource-allocation graph, ____.
A) a directed edge from a process to a resource is called an assignment edge
B) a directed edge from a resource to a process is called a request edge
C) a directed edge from a process to a resource is called a request edge
D) None of the above
55. Which of the following is true of multilevel queue scheduling?
A) Processes can move between queues.
B) Each queue has its own scheduling algorithm.
C) A queue cannot have absolute priority over lower-priority queues.
D) It is the most general CPU-scheduling algorithm.
56. What is the purpose of the mutex semaphore in the implementation of the bounded-buffer problem
using semaphores?
A) It indicates the number of empty slots in the buffer.
B) It indicates the number of occupied slots in the buffer.
C) It controls access to the shared buffer.
D) It ensures mutual exclusion.
57. ___________ is a formula that identifies potential performance gains from adding additional
computing cores to an application that has a parallel and serial component.
A) Task parallelism
B) Data parallelism
C) Data splitting
D) Amdahl’s Law
58. A process that has terminated, but whose parent has not yet called wait(), is known as a ________
process.
A) zombie
B) orphan
C) terminated
D) init
59. Which of the following statements is incorrect?
A) An operating system provides an environment for the execution of programs.
B) An operating system manages system resources.
C) Operating systems provide both command line as well as graphical user interfaces.
D) Operating systems must provide both protection and security.
________________________ ________________________ _________________________
(First Name) (Last Name) (Student ID)
2015 IS 12 of 20 03-60-330-01 Final Examination
60. Two important design issues for cache memory are ____.
A) speed and volatility
B) size and replacement policy
C) power consumption and reusability
D) size and access privileges
61. Consider a disk queue holding requests to the following cylinders in the listed order: 116, 22, 3, 11,
75, 185, 100, 87. Using the C-SCAN scheduling algorithm, what is the order that the requests are
serviced, assuming the disk head is at cylinder 88 and moving upward through the cylinders?
A) 116 – 22 – 3 – 11 – 75 – 185 – 100 – 87
B) 100 – 116 – 185 – 87 – 75 – 22 – 11 – 3
C) 87 – 75 – 100 – 116 – 185 – 22 – 11 – 3
D) 100 – 116 – 185 – 3 – 11 – 22 – 75 – 87
62. The _____ allocation algorithm allocates available memory to each process according to its size.
A) equal
B) global
C) proportional
D) slab
63. Consider a logical address with a page size of 8 KB. How many bits must be used to represent the
page offset in the logical address?
A) 10
B) 8
C) 13
D) 12
64. A cycle in a resource-allocation graph is ____.
A) a necessary and sufficient condition for deadlock in the case that each resource has more than one
instance
B) a necessary and sufficient condition for a deadlock in the case that each resource has exactly one
instance
C) a sufficient condition for a deadlock in the case that each resource has more than once instance
D) is neither necessary nor sufficient for indicating deadlock in the case that each resource has exactly
one instance
65. __________ involves the decision of which kernel thread to schedule onto which CPU.
A) Process-contention scope
B) System-contention scope
C) Dispatcher
D) Round-robin scheduling
________________________ ________________________ _________________________
(First Name) (Last Name) (Student ID)
2015 IS 13 of 20 03-60-330-01 Final Examination
66. How many philosophers may eat simultaneously in the Dining Philosophers problem with 5
philosophers?
A) 1
B) 2
C) 3
D) 5
67. Each thread has its own register set and stack.
A) True
B) False
68. Shared memory is a more appropriate inter-process communication mechanism than message passing
for distributed systems.
A) True
B) False
69. _____ is/are not a technique for passing parameters from an application to a system call.
A) Cache memory
B) Registers
C) Stack
D) Special block in memory
70. What are some other terms for kernel mode?
A) supervisor mode
B) system mode
C) privileged mode
D) All of the above
71. Which of the following disk head scheduling algorithms does not take into account the current
position of the disk head?
A) FCFS
B) SSTF
C) SCAN
D) LOOK
72. _____ is the algorithm implemented on most systems.
A) FIFO
B) Least frequently used
C) Most frequently used
D) LRU
________________________ ________________________ _________________________
(First Name) (Last Name) (Student ID)
2015 IS 14 of 20 03-60-330-01 Final Examination
73. Consider a logical address with 18 bits used to represent an entry in a conventional page table. How
many entries are in the conventional page table?
A) 262144
B) 1024
C) 1048576
D) 18
74. To handle deadlocks, operating systems most often _____.
A) pretend that deadlocks never occur
B) use protocols to prevent or avoid deadlocks
C) detect and recover from deadlocks
D) None of the above
75. A significant problem with priority scheduling algorithms is _____.
A) complexity
B) starvation
C) determining the length of the next CPU burst
D) determining the length of the time quantum
76. Which of the following statements is true?
A) A counting semaphore can never be used as a binary semaphore.
B) A binary semaphore can never be used as a counting semaphore.
C) Spinlocks can be used to prevent busy waiting in the implementation of semaphore.
D) Counting semaphores can be used to control access to a resource with a finite number of instances.
77. The single benefit of a thread pool is to control the number of threads.
A) True
B) False
78. Many operating system merge I/O devices and files into a combined file because of the similarity of
system calls for each.
A) True
B) False
79. Which of the following statements concerning open source operating systems is true?
A) Solaris is open source.
B) Source code is freely available.
C) They are always more secure than commercial, closed systems.
D) All open source operating systems share the same set of goals.
________________________ ________________________ _________________________
(First Name) (Last Name) (Student ID)
2015 IS 15 of 20 03-60-330-01 Final Examination
80. What are the two components of positioning time?
A) seek time + rotational latency
B) transfer time + transfer rate
C) effective transfer rate – transfer rate
D) cylinder positioning time + disk arm positioning time
81. _____ occurs when a process spends more time paging than executing.
A) Thrashing
B) Memory-mapping
C) Demand paging
D) Swapping
82. Assume a system has a TLB hit ratio of 90%. It requires 15 nanoseconds to access the TLB, and 85
nanoseconds to access main memory. What is the effective memory access time in nanoseconds for this
system?
A) 108.5
B) 100
C) 22
D) 176.5
83. Assume there are three resources, R1, R2, and R3, that are each assigned unique integer values 15, 10,
and 25, respectively. What is a resource ordering which prevents a circular wait?
A) R1, R2, R3
B) R3, R2, R1
C) R3, R1, R2
D) R2, R1, R3
84. The ______ occurs in first-come-first-served scheduling when a process with a long CPU burst
occupies the CPU.
A) dispatch latency
B) waiting time
C) convoy effect
D) system-contention scope
________________________ ________________________ _________________________
(First Name) (Last Name) (Student ID)
2015 IS 16 of 20 03-60-330-01 Final Examination
85. When using semaphores, a process invokes the wait() operation before accessing its critical
section, followed by the signal() operation upon completion of its critical section. Consider reversing
the order of these two operations—first calling signal(), then calling wait(). What would be a
possible outcome of this?
A) Starvation is possible.
B) Several processes could be active in their critical sections at the same time.
C) Mutual exclusion is still assured.
D) Deadlock is possible.
86. It is possible to create a thread library without any kernel-level support.
A) True.
B) False.
87. A _____ provides a file-system interface which allows clients to create and modify files.
A) compute-server system
B) file-server system
C) wireless network
D) network computer
88. Which of the following statements regarding solid state disks (SSDs) is false?
A) They generally consume more power than traditional hard disks.
B) They have the same characteristics as magnetic hard disks, but can be more reliable.
C) They are generally more expensive per megabyte than traditional hard disks.
D) They have no seek time or latency.
89. The _____ is an approximation of a program’s locality.
A) locality model
B) working set
C) page fault frequency
D) page replacement algorithm
90. Given the logical address 0xAEF9 (in hexadecimal) with a page size of 256 bytes, what is the page
number?
A) 0xAE
B) 0xF9
C) 0xA
D) 0x00F9
________________________ ________________________ _________________________
(First Name) (Last Name) (Student ID)
2015 IS 17 of 20 03-60-330-01 Final Examination
91. A _____ could be preempted from a process.
A) mutex lock
B) CPU
C) semaphore
D) file lock
92. The rate of a periodic task in a hard real-time system is ____, where p is a period and t is the
processing time.
A) 1/p
B) p/t
C) 1/t
D) pt
93. Another problem related to deadlocks is ____________.
A) race conditions
B) critical sections
C) spinlocks
D) indefinite blocking
94. It is possible to have concurrency without parallelism.
A) True.
B) False.
95. __________ is a set of software frameworks that provide additional services to application
developers.
A) System programs
B) Virtualization
C) Cloud computing
D) Middleware
96. Disk controllers do not usually have a built-in cache.
A) True
B) False
97. Systems in which memory access times vary significantly are known as __________.
A) memory-mapped I/O
B) demand-paged memory
C) non-uniform memory access
D) copy-on-write memory
________________________ ________________________ _________________________
(First Name) (Last Name) (Student ID)
2015 IS 18 of 20 03-60-330-01 Final Examination
98. Given the logical address 0xAEF9 (in hexadecimal) with a page size of 256 bytes, what is the page
offset?
A) 0xAE
B) 0xF9
C) 0xA
D) 0xF900
99. The circular-wait condition for a deadlock implies the hold-and-wait condition.
A) True.
B) False.
100. Which of the following is true of the rate-monotonic scheduling algorithm?
A) The task with the shortest period will have the lowest priority.
B) It uses a dynamic priority policy.
C) CPU utilization is bounded when using this algorithm.
D) It is non-preemptive.
________________________ ________________________ _________________________
(First Name) (Last Name) (Student ID)
2015 IS 19 of 20 03-60-330-01 Final Examination
Part II (100 marks) – Comprehensive
101. What is constant angular velocity in relation to disk drives?
Ans: If the rotation speed of a disk is to remain constant, the density of the bits must be changed for
different tracks to ensure the same rate of data moving under the head. This method keeps a constant
angular velocity on the disk.
102. Explain the sequence of events that happens when a page-fault occurs.
Ans: When the operating system cannot load the desired page into memory, a page-fault occurs. First, the
memory reference is checked for validity. In the case of an invalid request, the program will be
terminated. If the request was valid, a free frame is located. A disk operation is then scheduled to read the
page into the frame just found, update the page table, restart the instruction that was interrupted because
of the page fault, and use the page accordingly.
103. What is the context switch time, associated with swapping, if a disk drive with a transfer rate of 2
MB/s is used to swap out part of a program that is 200 KB in size? Assume that no seeks are necessary
and that the average latency is 15 ms. The time should reflect only the amount of time necessary to swap
out the process.
Ans: 200KB / 2048 KB per second + 15 ms = 113 ms
104. Explain what has to happen for a set of processes to achieve a deadlocked state.
Ans: For a set of processes to exist in a deadlocked state, every process in the set must be waiting for an
event that can be caused only be another process in the set. Thus, the processes cannot ever exit this state
without manual intervention.
105. Explain the concept of a CPU–I/O burst cycle.
Ans: The lifecycle of a process can be considered to consist of a number of bursts belonging to two different
states. All processes consist of CPU cycles and I/O operations. Therefore, a process can be modeled as
switching between bursts of CPU execution and I/O wait.
106. Explain two general approaches to handle critical sections in operating systems.
Ans: Critical sections may use preemptive or nonpreemptive kernels. A preemptive kernel allows a process
to be preempted while it is running in kernel mode. A nonpreemptive kernel does not allow a process
running in kernel mode to be preempted; a kernel-mode process will run until it exits kernel mode,
blocks, or voluntarily yields control of the CPU. A nonpreemptive kernel is essentially free from race
conditions on kernel data structures, as the contents of this register will be saved and restored by the
interrupt handler.
________________________ ________________________ _________________________
(First Name) (Last Name) (Student ID)
2015 IS 20 of 20 03-60-330-01 Final Examination
107. List the four major categories of the benefits of multithreaded programming. Briefly explain each.
Ans: The benefits of multithreaded programming fall into the categories: responsiveness, resource sharing,
economy, and utilization of multiprocessor architectures. Responsiveness means that a multithreaded
program can allow a program to run even if part of it is blocked. Resource sharing occurs when an
application has several different threads of activity within the same address space. Threads share the
resources of the process to which they belong. As a result, it is more economical to create new threads
than new processes. Finally, a single-threaded process can only execute on one processor regardless of the
number of processors actually present. Multiple threads can run on multiple processors, thereby
increasing efficiency.
108. Explain the main differences between a short-term and long-term scheduler.
Ans: The primary distinction between the two schedulers lies in the frequency of execution. The short-term
scheduler is designed to frequently select a new process for the CPU, at least once every 100
milliseconds. Because of the short time between executions, the short-term scheduler must be fast. The
long-term scheduler executes much less frequently; minutes may separate the creation of one new process
and the next. The long-term scheduler controls the degree of multiprogramming. Because of the longer
interval between executions, the long-term scheduler can afford to take more time to decide which
process should be selected for execution.
109. Describe the relationship between an API, the system-call interface, and the operating system.
Ans: The system-call interface of a programming language serves as a link to system calls made available
by the operating system. This interface intercepts function calls in the API and invokes the necessary
system call within the operating system. Thus, most of the details of the operating-system interface are
hidden from the programmer by the API and are managed by the run-time support library.
110. Explain the purpose of an interrupt vector.
Ans: The interrupt vector is merely a table of pointers to specific interrupt-handling routines. Because there
are a fixed number of interrupts, this table allows for more efficient handling of the interrupts than with a
general-purpose, interrupt-processing routine.
Leave a reply