Midterm Questions Flashcards

1
Q

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

A

Stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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

A

global variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

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

A

device queue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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

A

All of the above

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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

A

shared memory segments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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

A

pretend that deadlocks never occur (ostrich approach)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The number of processes that are completed per time unit

A

Throughput

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

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

A

SJF

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

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

A

monitor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

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

A

many-to-many model

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

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

A

All of the above

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

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

Circular Wait
Starvation
Mutual Exclusion
Hold and wait

A

Starvation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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?

A

The process state is changed from running to ready

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

A process control block ___

A

includes information on a process’s state

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

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

A

An unsafe state may lead to a deadlocked state

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which of the following scheduling algorithms could result in starvation?

FCFS, SJF, Round Robin

A

SJF

17
Q

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

A

Round Robin, Round Robin, FCFS

18
Q

T/F:

A thread is composed of a thread ID, program counter, register set, and heap

A

F

19
Q

T/F:

While a process is blocked on a semaphore’s queue, it is engaged in busy waiting

A

F

20
Q

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

A

T

21
Q

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

A

F

22
Q

T/F:

Spinlock has a better performance than semaphore even on single CPU and single core

A

F

23
Q

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

A

T

24
Q

T/F:

Assume x is a conditional variable, x.wait() will invoke busy waiting

A

F

25
Q

T/F:

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

A

F