Midterm Questions Flashcards Preview

OS Final Exam > Midterm Questions > Flashcards

Flashcards in Midterm Questions Deck (25)
Loading flashcards...
1

The ___ of a process contains temporary data such as function parameters, return addresses, and local variables

Stack

2

Which of the following component of program state are shared are shared across threads in a multi-threaded process?

register variables, local variables, global variables, stack memory

global variables

3

The list of a process waiting for an I/O device

device queue

4

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?

The child process runs concurrently with parent
The child process has a new program loaded into it
The child is a duplicate of the parent
All of the above

All of the above

5

When a process creates a new process using the fork() operation, what state is shared between parent process and child process?

shared memory segments

6

What is most often used by operating systems to handle deadlock?

pretend that deadlocks never occur (ostrich approach)

7

The number of processes that are completed per time unit

Throughput

8

___ scheduling is approximated by predicting the next CPU burst with an exponential average of the measured lengths of the previous CPU burst

SJF

9

Presents a set of programmer-defined operations that are provided mutual exclusion within it

monitor

10

The ___ multi-threading model multiplexes many user-level threads to a smaller or equal number of kernel threads

many-to-many model

11

Which of the following would be an acceptable signal handling scheme for a multi-threaded program?

Deliver the signal to the thread to which the signal applies
Deliver the signal to every thread in the process
Deliver the signal to only certain threads in the process
All of the above

All of the above

12

Which of the following is not a necessary condition for deadlock?

Circular Wait
Starvation
Mutual Exclusion
Hold and wait

Starvation

13

In a system where round robin is used for CPU scheduling, what happens when a process can't finish its computation during its current time quantum?

The process state is changed from running to ready

14

A process control block ___

includes information on a process's state

15

Which of the following is true?

A safe state is a deadlocked state
A safe state may lead to a deadlocked state
An unsafe state is always a deadlocked state
An unsafe state may lead to a deadlocked state

An unsafe state may lead to a deadlocked state

16

Which of the following scheduling algorithms could result in starvation?

FCFS, SJF, Round Robin

SJF

17

Fill in the blanks using scheduling algorithms (FCFS, SJF, Round Robin, Priority based)

In multi-level feedback queue, Q0 usually uses ___, Q1 uses ___, and Q3 uses ___.

Round Robin, Round Robin, FCFS

18

T/F:
A thread is composed of a thread ID, program counter, register set, and heap

F

19

T/F:
While a process is blocked on a semaphore's queue, it is engaged in busy waiting

F

20

T/F:
Starvation is a situation in which a process is denied access to a resource because of the competitive activity of other, possibly unrelated, processes

T

21

T/F:
Deadlock is a situation in which two or more processes (or threads) are waiting for an event that will occur in the future

F

22

T/F:
Spinlock has a better performance than semaphore even on single CPU and single core

F

23

T/F:
Assume that there are three queues in the multilevel feedback queue, only there are no jobs in the first two queues, the jobs in the third queue will be executed

T

24

T/F:
Assume x is a conditional variable, x.wait() will invoke busy waiting

F

25

T/F:
Assume x is a conditional variable, the process woken up by x.signal() will obtain a lock automatically

F