Professional Documents
Culture Documents
Multiple Choice
1. A situation where multiple computations are happening at same time by processes or threads
is termed
a) Mutual exclusion
b) Concurrency
c) Parallel processing
d) Inter-leaving
2. Concurrency will most likely occur in all of the following contexts except
a) Operating system structure
b) Multiprogramming
c) Multiprocessing
d) Uniprogramming
3. A section of code within a process that required access to shared resources is called?
a) Critical section
b) Trace of a process
c) Shared section
d) Non-critical section
4. Some of the challenges faced by operating system in handling concurrency include the
following except
a) Sharing resources
b) Communication among processes
c) Synchronization of multiple processes
d) generalization
5. which of the following is an example of mutual exclusion implementation using hardware?
a) Interrupt disabling
b) Semaphores
c) Messaging
d) Monitors
6. A resource which can be used by a process at a time without being depleted by that use is known as
a) nondepleted resource
b) Reusable resource
c) Consumable resource
d) Unconsumable resource
7. Which of the following is not an example of consumable resources?
a) Interrupt
b) Signals
c) Memory
d) Messages
8. A deadlock prevention technique is concerned about
a) Preventing the possibility of deadlock
b) Preventing the existence of deadlock
c) Aborting the deadlocked processes
d) Denying resources to processes if that will lead to deadlock
9. Which of the following is not one of techniques used to solving deadlock?
a) Deadlock avoidance
b) Deadlock suspension
c) Deadlock detection
d) Deadlock prevention
10. Which of the following best describe deadlock avoidance approach?
a) Abort the deadlock processes
b) Deny start or resource increment to process if that will lead to deadlock
c) Prevent possibility of deadlock
d) Roll-back process to pre-deadlock time
Essay
1. What is mutual exclusion
mutual exclusion is a property of concurrency control, which is instituted for the purpose of
preventing race conditions.
2. state four (4) requirement of mutual exclusion
*Only one process at a time is allowed in the critical section for a resource
*No deadlock or starvation
*A process remains inside its critical section for a finite time only.
*A process must not be delayed access to a critical section when there is no other process
using it.
3. Define the term Concurrency
Concurrency can be defined as a situation where multiple computations by the processes
or threads are happening at same time.
4. List any Four key terms associated with concurrency
-mutual exclusion
-starvation
-deadlock
-livelock
5. Explain one of the terms associated with concurrency
Deadlock: a situation in which two or more processes are unable to proceed because each
is waiting for one of the other to do something.
6. List the two (2) hardware approaches for implementing mutual exclusion
Interrupt Disabling
Special Machine Instructions
7. Explain each one of the approaches listed in 6.
Interrupt Disabling
A process runs until it invokes an operating system service or until it is interrupted
Disabling interrupts guarantees mutual exclusion
Essay
1. Define the terms deadlock and starvation
Deadlock: a situation in which two or more processes are unable to proceed because each
is waiting for one of the other to do something.
Starvation: a situation in which ha runnable process is overlooked indefinitely by the
scheduler.
2. What are the differences between reusable and consumable resources?
Resources can be reusable or consumable.
Reusable if they can be used again after a process is done using them. Memory, printers, tape
drives are examples of reusable resources.
Consumable resources are resources that can be used only once.
3. Give 3 examples each for reusable and consumable resource
Reusable Resource: Processors, I/O channels, main and secondary
memory.
Consumable Resource: Interrupts, signals, messages
4. Using resource allocation graph explain the process of deadlock for two process P1 and P2
competing over resources Ra and Rb.
8. Using banker’s algorithm show how the operating system will allocate resources to process to
avoid deadlock from the figure below ( not included )
3 2 2
6 1 3
3 1 4
8. In side process A, a byte holding data (a=200) has a physical address of 500, if the base register
of process A is 215, what is the relative address of that byte (a=200) what will be referenced by
the processor?
a) 500
b) 215
c) 285
d) 715
9. What is the use of a base register?
a) It holds information about the process execution
b) Buffer for storing starting address of a process in memory
c) Buffer for storing ending address of a process in memory
d) Buffer for storing the current address to be fetched from the process by the processor
e) None of the above
10. A process which is newly loaded into the system memory has the base register value of 786 and
the bound register value of 3858, what is the size of the process in KB.
a) 4KB
b) 1KB
c) 3KB
d) 2KB
11. Logical address in paging consist of a
a) Page number and offset
b) Page number only
c) Offset only
d) Page number and frame number
12. What is a virtual memory?
a) Location in secondary memory where content of a suspended process is temporarily
stored
b) Location in cache memory where content of a suspended process is temporarily stored
c) Location in main memory where content of a suspended process is temporarily stored
d) Not a real memory
13. What is the use of page table?
a) It’s used by operating system to update the most recent location of a page in the memory
b) It’s used to store process data
c) It is use for updating virtual memory
d) It is use to swap process to virtual memory
Essays