CS 370 Final

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/99

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 12:56 AM on 7/3/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

100 Terms

1
New cards

Q1

Q1

2
New cards

Unlike processor exceptions, interrupts are triggered by process executions.

False

3
New cards

Consider the memory hierarchy depicted in the figure.

-Registers

-cache

-main mem

-Electronic disk

(Above Volatile)

- magnetic disk

-optical disk

- mag tapes

The access times decrease as you traverse up the memory (tapes-to-registers) hierarchy.

True

4
New cards

To ensure efficiency and uninterrupted execution, processes executing in the user mode are allowed to disable timer interrupts.

False

5
New cards

The interrupt vector table allows the processor to quickly identify the precise kernel routine to handle interrupts, processor exceptions, and system call traps.

True

6
New cards

The ISA (Instruction Set Architecture) for most processors include instructions that operate on disk addresses in addition to those that operate on registers and memory locations.

False

7
New cards

The only way a process can execute a privileged instruction is when it is running in kernel mode.

True

8
New cards

Processes must be able to have read access permissions to regions in memory that belong to other processes to maximize performance and ensure high throughput.

False

9
New cards

Processes running in user mode do not have full access to the system's hardware. To access sensitive resources from the systems, all processes must be mediated by the Operating System, which runs in kernel mode.

True

10
New cards

The code for the kernel is a small fraction of the codebase for the Operating System and provides core functionality for the OS processes to use.

True

11
New cards

Consider the memory hierarchy depicted in the figure.

The cost-per-bit increases as you traverse down (registers-to-tape) the memory hierarchy.

-Registers

-cache

-main mem

-Electronic disk

(Above Volatile)

- magnetic disk

-optical disk

- mag tapes

The access times decrease as you traverse up the memory (tapes-to-registers) hierarchy.

False

12
New cards

Q2

Q2

13
New cards

The process control block (PCB) contains information about a process and is used during context-switching between processes. The PCB for every process is maintained in the cache.

False

14
New cards

The reason that the child executes the instruction after fork() is that the child's address-space is a bitwise identical copy of the parent, including the values of the program counter.

True

15
New cards

Consider the code snippet:

childPID = fork()

The parent has a process-ID of 31425 and the newly created child has a process-ID of 27182.

The value of the variable childPID in the parent is ____________.

a. 31425

b. 0

c. 27182

c. 27182

16
New cards

Consider the code snippet:

childPID = fork()

The parent has a process-ID of 31425 and the newly created child has a process-ID of 27182.

The value of the variable childPID in the child is ____________.

a. 31425

b. 0

c. 27182

b. 0

17
New cards

When fork() fails, it is possible that a child may still be created.

False

18
New cards

Temporary variables of a function/method are allocated on the stack.

True

19
New cards

How many processes in the process tree, constructed by the code-snippet below, have no child?

for (int i = 1; i < 4; i++) {

if (childid = fork()) {

break;

}

}

1 or 1 (with margin: 0)

20
New cards

All processes in UNIX are created using the fork() system call.

True

21
New cards

Every process needs its own stack and heap.

True

22
New cards

Process creation using fork() results in a copy of the parent's memory image. Assume that a new program is not loaded into the child using the exec() command. After the fork() operation, when a variable is changed in the parent process, this change is reflected in the child process.

False

23
New cards

Q3

Q3

24
New cards

In the Producer-Consumer problem, if a bounded buffer is used, and the producer produces at twice the rate of the consumer, then the buffer will remain full and the producer will spend time waiting for the consumer to take items off the queue.

True

25
New cards

An advantage of the Microkernel architecture is that since most functionality is provided as user processes, even if one of these user processes crashes, it does not result in a crash of the operating system.

True

26
New cards

In UNIX a child process inherits any pipes that belong to its parent.

Ture

27
New cards

Servers are always launched as foreground processes.

False

28
New cards

A device driver is based on a standard interface that the kernel provides, allowing the OS to use the underlying hardware seamlessly.

True

29
New cards

RPC allows a process to invoke a function in another process over the network.

True

30
New cards

A FIFO pipe's lifespan is no longer than the process that created it.

False

31
New cards

After launching a process in the shell with a trailing '&' character, you can terminate it with CTRL + C.

False

32
New cards

When performing IPC between processes using shared memory, it is the kernel's responsibility to ensure safety among processes by avoiding race conditions.

False

33
New cards

Inter-process communications using message passing is significantly faster than using shared memory communications.

False

34
New cards

Q4

Q4

35
New cards

The overheads for scheduling kernel threads is almost as expensive as that for processes.

True

36
New cards

Regardless of the recursion depth of an executing thread, there can only be 1 frame on that thread's stack.

False

37
New cards

Threads within a process cannot share the process heap.

False

38
New cards

A single threaded process can only execute on one core, regardless of how many cores are available.

True

39
New cards

In a many-to-one threading model, when one of the user-level threads in the process makes a blocking call, other user-level threads can be scheduled for execution to maximize concurrency.

False

40
New cards

In the case of user-level threads, it is the programmer's responsibility to avoid lock-out situations by forcing CPU-bound threads within that process to yield control.

Ture

41
New cards

A process with 4 threads has 5 program counters; one for each thread, and one for the process.

False

42
New cards

Threads within a process share the same program counter.

False

43
New cards

When a process crashes, some threads within that process can continue to operate.

False

44
New cards

Threads within a process must have their own stack.

True

45
New cards

Q5

Q5

46
New cards

Consider the code snippet below which someone claims is the entry section to the critical section for process Pi in Peterson's solution.

flag[i] = TRUE;

turn = i;

while (flag[i] && turn==i) {;}

Is this a valid entry section?

- Yes; processes will take turns entering the critical section.

- Yes; processes are assured progress.

- No; processes will never enter the critical section because they are busy waiting.

- No; processes don't have to wait to enter the critical section

No; processes will never enter the critical section because they are busy waiting.

47
New cards

For a set of processes involved in a race condition, the outcome depends on the order in which data accesses take place.

True

48
New cards

In Peterson's solution, bounded wait is possible because the algorithm allows processes to take turns entering the critical section.

True

49
New cards

Solutions to the critical section problem must target mutual exclusion but not necessarily bounded-wait.

False

50
New cards

Peterson's solution is a software solution to the critical section problem involving an arbitrary number of processes.

False

51
New cards

In the priority inheritance protocol, a process accessing a resource needed by higher priority process forces the higher priority process to lower its priority while it finishes resource usage.

False

52
New cards

In solutions to the critical section problem, processes that are executing in their remainder section make decisions about who gets to enter the critical section next.

False

53
New cards

Consider a system of n processes, each with a different critical section where common variables are being modified. At most 2 processes can execute in their critical section at the same time.

False

54
New cards

A process may have multiple, unrelated critical sections.

True

55
New cards

A process executing an atomic hardware instruction cannot be context-switched regardless of how many clock cycles it takes to complete that instruction.

True

56
New cards

Q6

Q6

57
New cards

There are no scenarios when a spinlock should be used instead of a semaphore or mutex.

False

58
New cards

The signal() operation on a monitor is not persistent. If a signal() is performed, and no process is waiting that signal is ignored.

True

59
New cards

Assume a system crashes and is brought back up with the following checkpoint-based log.

// begin of log //

// end of log //

Which transactions must be redone?

-T3 and T4

-T5

- T3 and T5

-T4

- T3 and T5

60
New cards

The binary semaphore can be used in settings involving more than two processes trying to coordinate accesses to the critical section.

True

61
New cards

Assume a system crashes and is brought back up with the following checkpoint-based log.

// begin of log //

// end of log //

Which transactions must be undone?

-T3

-T3 and T4

-T5

-T4

-T4

62
New cards

Every instruction must execute within the confines of a thread, but that statement may be executed by multiple threads.

True

63
New cards

Timestamp-based locking protocols do not suffer from deadlocks.

True

64
New cards

Turnstiles are queue structures containing threads blocked on a lock. Turnstiles are associated with threads not objects.

True

65
New cards

In the producer-consumer problem with a bounded-buffer, if the buffer is full and the producer is ready to add content, the size of the buffer is automatically extended to reduce producer wait times.

False

66
New cards

A transaction can be context-switched in the middle of its execution.

True

67
New cards

Q7

Q7

68
New cards

The round-robin (RR) scheduling algorithm could result in starvation.

False

69
New cards

When writing programs, you must plan for context switches that occur during process execution.

False

70
New cards

Scenario: Consider a set of CPU-bound processes with known execution-times waiting to be scheduled at time T0. Also assume that no other processes will enter the system later.

Question: If the objective is to minimize the average waiting time, shortest job first will be the best way to ensure this.

True

71
New cards

In CFS, the quantum associated with a process might change depending on how many processes are ready for execution.

Ture

72
New cards

Several dominant OS such as Windows, Linux, and MacOS use the Multilevel Feedback Queue (MFQ) based scheduling algorithm.

Please indicate if the following statement about MFQ is true or false:

Tasks at a higher priority preempt lower priority tasks.

True

73
New cards

The shortest jobs first (SJF) scheduling algorithm provides optimal waiting times for a set of jobs that arrive simultaneously.

True

74
New cards

In the MFQ scheduling algorithm, the quantum associated with processes at the same level is identical.

True

75
New cards

As CPUs get faster, the average process becomes more and more CPU-bound.

False

76
New cards

Several dominant OS such as Windows, Linux, and MacOS use the Multilevel Feedback Queue (MFQ) based scheduling algorithm.

Please indicate if the following statement about MFQ is true or false:

Instead of only a single queue, MFQ has multiple round-robin queues. Each queue has a different priority level and time quanta.

True

77
New cards

The first-come, first-served (FCFS) scheduling algorithm could result in starvation.

False

78
New cards

Q8

Q8

79
New cards

Consider a situation where there are infinite instances of all different resources types in the system. Within a set of N processes, how many safe sequences are possible?

N!

1

N

N * N

N!

80
New cards

Using the following vector of available resources, along with currently allocated resources to each process and their maximum needs, determine if

Allocation Max Available

A B C A B C A B C

P0 0 1 0 7 5 3 2 3 0

P1 3 0 2 3 2 2

P2 3 0 2 9 0 2

P3 2 1 1 2 2 2

P4 0 0 2 4 3 3

True

81
New cards

The Banker's Algorithm allocates resources to requests based on the order in which they arrive. They do not stall any requests for resource allocations.

False

82
New cards

The state of the system at time T0 is as depicted below. At time T1, P0 decides to request 2 more instances of resource B. Is it safe to satisfy this request?

Allocation Max Available

A B C A B C A B C

P0 0 1 0 7 5 3 2 3 0

P1 3 0 2 3 2 2

P2 3 0 2 9 0 2

P3 2 1 1 2 2 2

P4 0 0 2 4 3 3

False

83
New cards

Deadlock prevention algorithms must target all four of the conditions: mutual exclusion, hold-and-wait, no preemption, and circular wait - to eliminate the possibility of deadlocks.

False

84
New cards

The Banker's Algorithm allows us to identify a safe sequence for a set of processes based on the current allocation of resources and the maximum needs of each process.

True

85
New cards

There are limits to the number of entries in the process table, open file tables, and such. To cope with deadlocks in such situations, it is common for the OS designers to first decide on the number of users N who would be concurrently active at a given time and then place restrictions on users based on this choice of N. That is, if the number of concurrent processes is restricted to say 30000 then each user is allowed to spawn a maximum of 30000/N processes.

False

86
New cards

A resource allocation graph is being used to represent resource requests by processes and allocation of resources to processes. In the system that we consider, there are multiple instances of a given resource type. In this resource allocation graph, the presence of a cycle in the directed edges representing the request and assignment edges for a set of resources and processes indicates that a deadlock has definitely occurred.

False

87
New cards

When logging into your team's Virtual Machine for the term project, what is the username you will use?

https://infospaces.cs.colostate.edu/watch.php?id=230

kubeuser

cs370user

minikube

cs370team

kubeuser

88
New cards

Once in your Virtual Machine for the term project, which command do you use to start a localized Kubernetes cluster?

minikube cluster --start

kubeadm init

kubectl start --driver=docker

minikube start --driver=docker

minikube start --driver=docker

89
New cards

Q9

Q9

90
New cards

Two processes A and B are executions of the same program X. This program X has an execution sequence that results in access to a hardcoded logical-memory location 0x100ACFFED. When there are two running instances of this program, such as processes A and B, this would mean that accesses from A and B to the hardcoded logical-memory location will result in accesses to two different physical memory locations.

TRUE

91
New cards

In segmentation, each segment can have different protections associated with it.

True

92
New cards

It is impossible to avoid internal fragmentation in contiguous memory allocations.

Ture

93
New cards

Dynamic linking results in wasted disk space and memory utilization because of the duplication inefficiency that can result in multiple copies of key libraries.

Fasle

94
New cards

A pure swapping-based approach brings the entire process in to memory at a time.

True

95
New cards

When using segmentation, it is not possible to have multiple logical address spaces within the same process.

False

96
New cards

In segmentation, each segment can be of a different size.

True

97
New cards

Since memory is several orders of magnitude faster than disk, compaction of memory spaces is viable and performed periodically (every second) by the OS in contiguous memory allocations.

False

98
New cards

It is impossible to avoid external fragmentation in contiguous memory allocations.

False

99
New cards

The defragmentation (or compaction) overhead for the swap space on disk is low enough that the OS can perform this operation periodically.

False

100
New cards

Q10- all duplicates

Q10- all duplicates