Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

practice_exerc

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

3) A system call is triggered by hardware.

a. True

b. False

4) 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.


5) Which of the following is an inter-process communication that requires two processes
share memory?

a. message passing

b. shared memory

c. socket communication

d. all of the above

6) Which of the following is not an operating system service?

a. program execution

b. I/O operation

c. protection and security

d. graphical user interface

7) Microkernels use _____ for communication.

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

11) What is the degree of multiprogramming for a single-processor system?

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()

14) Which of the following IPC mechanism is easier to implement in a distributed


system?

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;

c. All the elements of the buffer can be used;

d. Both A and C

16) Ordinary pipes are unidirectional, allowing only one-way communication.

a. True

b. False

17) The communication with named pipes requires parent-child relationship.

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

d. all of the above

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

20) In Java, data shared between threads is simply declared globally.

a. True

b. False

21) Which of the following is an asynchronous signal?

a. illegal memory access

b. division by zero

c. terminating a process with specific keystrokes

d. none of the above

22) LWP is ____.

a. short for lightweight processor

b. placed between system and kernel threads

c. placed between user and kernel threads

d. common in systems implementing one-to-one multithreading models


23) Thread-local storage is inherently equivalent to local variables.

a. True

b. False

24) The ready queue can be implemented as a _______________.

a. FIFO queue

b. priority queue

c. tree

d. unordered linked list

e. all of the above

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

b. save state into PCB0, and restore state from PCB1

c. P1 executing

d. all of the above

26) Which of the following criteria is more important for an interactive system?

a. CPU utilization

b. Response time

c. Turnaround time

d. Throughput

27) Round-robin (RR) scheduling degenerates to first-come-first-served (FCFS)


scheduling if the time quantum is too long.
a. True

b. False

28) Which of the following scheduling algorithms gives the minimum average response
time?

a. SJF

b. FCFS

c. RR

d. Multilevel queue

29) Which of the following scheduling algorithms must be nonpreemptive?

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--

c. both of the above

d. none of the above

34) Which of the following actions should be performed among cooperating processes?

a. process synchronization

b. coordination

c. both of the above

d. none of the above

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

d. none of the above

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

d. none of the above

37) Which of the following is not true about test_and_set instruction?

a. It is a hardware instruction

b. It is executed atomically

c. Returns the original value of passed parameter

d. Returns the new value of passed parameter

e. Set the new value of passed parameter to “TRUE”

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?

a. while (compare and swap(&lock, 0, 1) != 0), do nothing;

b. while (test and set(&lock)), do nothing;

c. both A and B

d. none of the above

39) Spinlocks are not appropriate for single-processor systems.

a. True

b. False

40) 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.
41) Which of the following is NOT true?

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

d. all of the above

42) When the mutex lock is implemented based on a binary semaphore, it should be
initialized to be 0.

a. True

b. False

You might also like