Professional Documents
Culture Documents
Practice Mid
Practice Mid
1) Which of the following components of a computer system defines the ways to use
system resources to solve computing problems?
a. application programs
b. operating system
c. computer hardware
d. computer logo
2) Which of the following stage triggers the CPU switch from user program to interrupt
processing?
a. I/O request
b. transfer done
c. interrupt signaled
d. interrupt handled
a. True
b. False
c. Operating systems provide both command line as well as graphical user interfaces.
a. message passing
b. shared memory
c. socket communication
a. program execution
b. I/O operation
a. message passing
b. shared memory
c. system calls
d. virtualization
8) Which of the following contains dynamically allocated data during program run time?
a. text section
b. data section
c. heap section
d. stack section
9) Which of the following process state will be switched from “running” state when an
interrupt occurs?
a. ready
b. terminated
c. waiting
d. new
10) For a single-processor system, there will never be more than one process in the
Running state.
a. True
b. False
a. 0
b. 1
c. 2
d. 3
12) Which of the following selects from among the processes that are in the ready queue
to execute and allocate the CPU to one of them?
a. CPU scheduler
b. context switch
c. swapping
d. job scheduler
13) Which of the following system calls is used to have a new program loaded into the
new process’s memory space?
a. fork()
b. exec()
c. wait()
d. exit()
a. shared memory
b. message passing
c. socket communication
d. ordinary pipe
15) Assume the shared buffer is implemented as a circular array with two logical
pointers: in and out
a. The buffer is empty when in == out; the buffer is full when ((in + 1) % BUFFER SIZE)
== out;
b. The buffer is full when in == out; the buffer is empty when ((in + 1) % BUFFER SIZE)
== out;
d. Both A and C
a. True
b. False
a. True
b. False
18) Which of the following items are shared across multiple threads belonging to the
same process?
a. code, data, files
b. registers
c. stack
19) Which of the following refers to the capability to allow multiple tasks make progress
on a single processor system?
a. concurrency
b. parallelism
c. data parallelism
d. task parallelism
a. True
b. False
b. division by zero
a. True
b. False
a. FIFO queue
b. priority queue
c. tree
25) Assume process P0 and P1 are the process before and after a context switch, and
PCB0 and PCB1 are respectively their process control block
a. P0 executing
c. P1 executing
26) Which of the following criteria is more important for an interactive system?
a. CPU utilization
b. Response time
c. Turnaround time
d. Throughput
b. False
28) Which of the following scheduling algorithms gives the minimum average response
time?
a. SJF
b. FCFS
c. RR
d. Multilevel queue
a. SJF
b. RR
c. FCFS
d. priority algorithms
30) Which of the following scheduling algorithm may suffer from convoy effect?
a. SJF
b. FCFS
c. RR
d. Multilevel queue
31) Load balancing algorithms have no impact on the benefits of processor affinity.
a. True
b. False
32) A multicore system allows two (or more) threads that are in compute cycles to
execute at the same time.
a. True
b. False
33) Assume count is a variable name, which of the following operations is atomic?
a. count++
b. count--
34) Which of the following actions should be performed among cooperating processes?
a. process synchronization
b. coordination
35) Which of the following critical-section problem’s requirements ensures programs will
cooperatively determine what process will next enter its critical section?
a. mutual exclusion
b. progress
c. bounded waiting
36) Which of the following variables are shared between the processes in Peterson’s
solution?
a. int turn
b. boolean flag[2]
c. both of the above
a. It is a hardware instruction
b. It is executed atomically
38) Assume the binary variable lock is initialized to be 0, which of the following can be
an implementation of the entry section to solve the critical-section problem?
c. both A and B
a. True
b. False
a. Since semaphore and mutex lock are tools for synchronization, process that have
used semaphores or mutex locks should not cause deadlocks
b. Semaphores and mutex locks may be shared resources that difference processes
contend for, and hence deadlocks may occur
c. a set of processes is in a deadlocked state when every process in the set is waiting for
an event that can be caused only by another process in the set
42) When the mutex lock is implemented based on a binary semaphore, it should be
initialized to be 0.
a. True
b. False