Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Login

Register Now

Welcome to All Test Answers

Midterm -Summer 2016-Operating System – Solutions


 

 

Download  file with the answers

Not a member!
Create a FREE account here to get access and download this file with answers


 

MIDTERM EXAMINATION
OPERATING SYSTEM CONCEPTS
03-60-330-01 Intersession 2016
UNIVERSITY OF WINDSOR
SCHOOL OF COMPUTER SCIENCE
1. This is a CLOSED book test; no notes, textbooks, calculators or computer aids are
allowed.
2. PRINT your name legibly and clearly with your Student ID in the spaces indicated on the
Scantron sheet.
3. There are 17 pages in this exam. Part I is on Page-2 and Part II is on Page-11.
4. In each Multiple Choice question, 2-4 responses are provided – you are to choose only
one response which best answers the question. Use the Scantron sheet provided to
indicate your answers. Circle the letter A, B, C or D (one only).
5. For True/False types of questions, circle either A or B.
6. Place all responses on the approved Scantron marking sheet using PENCIL.
7. If an error is made you must carefully erase the error and then fill in the circle you intend
to choose.
8. You are not allowed to give or receive unauthorized help with your test. Any
misconduct, as outlined by the Senate bylaw 31 article I, will be reported accordingly.
9. You have 75 minutes to complete this test.
The total mark is 100.
Last Name :
First Name :
Student Number :
2
Part I (50 marks — 1 mark/question) – Multiple Choice Questions
USE PENCIL ONLY ON THE SCANTRON SHEET
1. In what way is an operating system like a government?
A) It seldom functions correctly.
B) It creates an environment within which other programs can do useful work.
C) It performs most useful functions by itself.
D) It is always concerned primarily with the individual’s needs.
2. A _____ is an example of a systems program.
A) command interpreter
B) Web browser
C) text formatter
D) database system.
3. The ____ of a process contains temporary data such as function parameters, return
addresses, and local variables.
A) text section
B) data section
C) program counter
D) stack
4. Pthreads refers to ____.
A) the POSIX standard.
B) an implementation for thread behavior.
C) a specification for thread behavior.
D) an API for process creation and synchronization.
5. A race condition ____.
A) results when several threads try to access the same data concurrently
B) results when several threads try to access and modify the same data concurrently
C) will result only if the outcome of execution does not depend on the order in
which instructions are executed
D) None of the above
3
6. Absolute code can be generated for ____.
A) compile-time binding
B) load-time binding
C) execution-time binding
D) interrupt binding
7. Which of the following is a benefit of allowing a program that is only partially in
memory to execute?
A) Programs can be written to use more memory than is available in physical memory.
B) CPU utilization and throughput is increased.
C) Less I/O is needed to load or swap each user program into memory.
D) All of the above
8. In systems that support virtual memory, ____.
A) virtual memory is separated from logical memory.
B) virtual memory is separated from physical memory.
C) physical memory is separated from secondary storage.
D) physical memory is separated from logical memory.
9. _____ is the method of binding instructions and data to memory performed by most
general-purpose operating systems.
A) Interrupt binding
B) Compile time binding
C) Execution time binding
D) Load-time binding
10. An instruction that executes atomically ____.
A) must consist of only one machine instruction
B) executes as a single, uninterruptible unit
C) cannot be used to solve the critical section problem
D) All of the above
4
11. The ____ multithreading model multiplexes many user-level threads to a smaller
or equal number of kernel threads.
A) many-to-one model
B) one-to-one model
C) many-to-many model
D) many-to-some model
12. A process control block ____.
A) includes information on the process’s state
B) stores the address of the next instruction to be processed by a different process
C) determines which process is to be executed next
D) is an example of a process queue
13. If a program terminates abnormally, a dump of memory may be examined by a
____ to determine the cause of the problem.
A) module
B) debugger
C) shell
D) control card
14. ____ operating systems are designed primarily to maximize resource utilization.
A) PC
B) Handheld computer
C) Mainframe
D) Network
15. A message-passing model is ____.
A) easier to implement than a shared memory model for intercomputer communication
B) faster than the shared memory model
C) a network protocol, and does not apply to operating systems
D) only useful for small simple operating systems
5
15. The list of processes waiting for a particular I/O device is called a(n) ____.
A) standby queue
B) device queue
C) ready queue
D) interrupt queue
17. Thread-local storage is data that ____.
A) is not associated with any process
B) has been modified by the thread, but not yet updated to the parent process
C) is generated by the thread independent of the thread’s process
D) is unique to each thread
18. A counting semaphore ____.
A) is essentially an integer variable
B) is accessed through only one standard operation
C) can be modified simultaneously by multiple threads
D) cannot be used to control access to a thread’s critical sections
19. An address generated by a CPU is referred to as a ____.
A) physical address
B) logical address
C) post relocation register address
D) Memory-Management Unit (MMU) generated address
20. In general, virtual memory decreases the degree of multiprogramming in a system.
A) True
B) False
21. A relocation register is used to check for invalid memory addresses generated by a CPU.
A) True
B) False
6
22. Race conditions are prevented by requiring that critical regions be protected by locks.
A) True
B) False
23. A traditional (or heavyweight) process has a single thread of control.
A) True
B) False
24. The difference between a program and a process is that a program is an active
entity while a process is a passive entity.
A) True
B) False
25. System calls can be run in either user mode or kernel mode.
A) True
B) False
26. The operating system kernel consists of all system and application programs in
a computer.
A) True
B) False
27. A system call is triggered by hardware.
A) True
B) False
28. Application programmers typically use an API rather than directory invoking
system calls.
A) True
B) False
7
29. The exec() system call creates a new process.
A) True
B) False
30. A thread is composed of a thread ID, program counter, register set, and heap.
A) True
B) False
31. The value of a counting semaphore can range only between 0 and 1.
A) True
B) False
32. There is a 1:1 correspondence between the number of entries in the TLB and the number
of entries in the page table.
A) True
B) False
33. Hierarchical page tables are appropriate for 64-bit architectures.
A) True
B) False
34. Mutex locks and counting semaphores are essentially the same thing.
A) True
B) False
35. Virtually all contemporary operating systems support kernel threads.
A) True
B) False
8
36. For a single-processor system, there will never be more than one process in the Running
state.
A) True
B) False
37. Interrupts may be triggered by either hardware of software
A) True
B) False
38. The most common secondary storage device is ____.
A) random access memory
B) solid state disks
C) tape drives
D) magnetic disk
39. Policy ____.
A) determines how to do something
B) determines what will be done
C) is not likely to change across places
D) is not likely to change over time
40. The _____________ refers to the number of processes in memory.
A) process count
B) long-term scheduler
C) degree of multiprogramming
D) CPU scheduler
41. _____ is not considered a challenge when designing applications for multicore systems.
A) Deciding which activities can be run in parallel
B) Ensuring there is a sufficient number of cores
C) Determining if data can be separated so that it is accessed on separate cores
D) Identifying data dependencies between tasks.
9
42. A mutex lock ____.
A) is exactly like a counting semaphore
B) is essentially a boolean variable
C) is not guaranteed to be atomic
D) can be used to eliminate busy waiting
43. The mapping of a logical address to a physical address is done in hardware by the ________.
A) memory-management-unit (MMU)
B) memory address register
C) relocation register
D) dynamic loading register
44. In a dynamically linked library, ____.
A) loading is postponed until execution time
B) system language libraries are treated like any other object module
C) more disk space is used than in a statically linked library
D) a stub is included in the image for each library-routine reference
45. ____________ occurs when a higher-priority process needs to access a data structure that is
currently being accessed by a lower-priority process.
A) Priority inversion
B) Deadlock
C) A race condition
D) A critical section
46. A ____ provides an API for creating and managing threads.
A) set of system calls
B) multicore system
C) thread library
D) multithreading model
10
47. When a child process is created, which of the following is a possibility in terms of the
execution or address space of the child process?
A) The child process runs concurrently with the parent.
B) The child process has a new program loaded into it.
C) The child is a duplicate of the parent.
D) All of the above
48. The major difficulty in designing a layered operating system approach is ____.
A) appropriately defining the various layers
B) making sure that each layer hides certain data structures, hardware, and
operations from higher-level layers
C) debugging a particular layer
D) making sure each layer is easily converted to modules
49. 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
50. What is the correct order of operations for protecting a critical section using mutex
locks?
A) release() followed by acquire()
B) acquire() followed by release()
C) wait() followed by signal()
D) signal() followed by wait().
11
Part II (50 marks) – Essay and Short Answer Questions
51. [6 marks] Explain why an operating system can be viewed as a resource allocator.
Answer: A computer system has many resources that may be required to solve a
problem: CPU time, memory space, file-storage space, I/O devices, and so on. The
operating system acts as the manager of these resources. Facing numerous and possibly
conflicting requests for resources, the operating system must decide how to allocate them
to specific programs and users so that it can operate the computer system efficiently and
fairly.
52. [10 marks] There are two different ways that commands can be processed by a
command interpreter. One way is to allow the command interpreter to contain the code
needed to execute the command. The other way is to implement the commands through
system programs. Compare and contrast the two approaches.
Answer: In the first approach, upon the user issuing a command, the interpreter jumps to
the appropriate section of code, executes the command, and returns control back to the
user. In the second approach, the interpreter loads the appropriate program into memory
along with the appropriate arguments. The advantage of the first method is speed and
overall simplicity. The disadvantage to this technique is that new commands require
rewriting the interpreter program which, after a number of modifications, may get
complicated, messy, or too large. The advantage to the second method is that new
commands can be added without altering the command interpreter. The disadvantage is
reduced speed and the clumsiness of passing parameters from the interpreter to the
system program.
53. [6 marks] Name and describe the different states that a process can exist in at any
given time.
Answer: The possible states of a process are: new, running, waiting, ready, and
terminated. The process is created while in the new state. In the running or waiting state,
the process is executing or waiting for an event to occur, respectively. The ready state
occurs when the process is ready and waiting to be assigned to a processor and should not
be confused with the waiting state mentioned earlier. After the process is finished
executing its code, it enters the termination state.
54. [6 marks] Why should a web server not run as a single-threaded process?
Answer: For a web server that runs as a single-threaded process, only one client can be
serviced at a time. This could result in potentially enormous wait times for a busy server.
12
55. [6 marks] What three conditions must be satisfied in order to solve the critical
section problem?
Answer: In a solution to the critical section problem, no thread may be executing in its
critical section if a thread is currently executing in its critical section. Furthermore, only
those threads that are not executing in their critical sections can participate in the decision
on which process will enter its critical section next. Finally, a bound must exist on the
number of times that other threads are allowed to enter their critical state after a thread
has made a request to enter its critical state.
56. [6 marks] What is the advantage of using dynamic loading?
Answer: With dynamic loading a program does not have to be stored, in its entirety, in
main memory. This allows the system to obtain better memory-space utilization. This
also allows unused routines to stay out of main memory so that memory can be used
more effectively. For example, code used to handle an obscure error would not always
use up main memory.
57. [10 marks] Explain the distinction between a demand-paging system and a paging
system with swapping.
Answer: A demand-paging system is similar to a paging system with swapping where
processes reside in secondary memory. With demand paging, when a process is executed,
it is swapped into memory. Rather than swapping the entire process into memory,
however, a lazy swapper is used. A lazy swapper never swaps a page into memory unless
that page will be needed. Thus, a paging system with swapping manipulates entire
processes, whereas a demand pager is concerned with the individual pages of a process.

About

Leave a reply

Captcha Click on image to update the captcha .

error: Content is protected !!