Online Big Flashcards

1
Q

Which one is data register?

A

AC

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

A control/status register that contains the address of the next instruction to be fetched is called the:

A

Program Counter (PC)

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

A fetched instruction is normally loaded into the:

A

Instruction Register (IR)

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

By what method of dealing with multiple interrupts, interrupts are handled in strict sequential order?

A

Disable interrupts while an interrupt is being processed

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

As one proceeds down the memory hierarchy (i.e. from inboard memory to offline storage), the following condition(s) apply:

A

increasing access time

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

The _____ routine determines the nature of the interrupt and performs whatever actions are needed.

A

interrupt handler

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

The _____ chooses which block to replace when a new block is to be loaded into the cache and the cache already has all slots filled with other blocks.

A

memory controller

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

_____ refers to the tendency of execution to involve a number of memory locations that are clustered in physical memory, therefore the performance can be improved by cache

A

spatial locality

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

What is the problem of I/O process without interrupt, compared to the one with interrupt?

A

Waste CPU Cycles on periodically check the status of I/O devices

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

Interrupt-driven I/O, although more efficient than simple Programmed I/O, still requires the use of the _____ to transfer data between memory and an I/O module

A

CPU

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

In multiprocessor environments, two copies of the same data may reside in the local cache of each CPU. Whenever one CPU alters the data, the cache of the other CPU must receive an updated version of this data. This is called Cache _____

A

coherency

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

_____ was an early innovation that helped decrease the amount time the computer wasted between jobs.

A

Batch processing

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

The _____ defines the system call interface to the operating system

A

Application binary interface (API)

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

The _____ is the interface that is the boundary between hardware and software.

A

ISA

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

In a SMP system, “availability” is improved because

A

The failure of a single processor does not halt the system

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

A major problem with early serial processing systems was

A

Setup time

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

What is the name of Operating System for the early Serial Processing computer systems?

A

There is none (not Monitor, JCL, Main Frame)

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

The principle objective for a time sharing system is to:

A

Reduce response time

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

In a “Simple Batch System”, _____ is used to prevent a single job from monopolizing the system, if it expires, the user program is stopped, and control returns to the monitor.

A

Timer

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

Mean time to repair (MTTR) can be seen as average _____.

A

downtime

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

What statement about microkernel is NOT true?

A

It is a implemented as a single process, with all elements sharing the same address space

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

Early operating systems that were designed with little concern about structure are typically referred to as:

A

Monolithic Operating Systems

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

The operating system provides many types of services to end-users, programmers and system designers, including:

A

Error detection and response

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

In time sharing systems, the technique where a system clock generates interrupts, and at each clock interrupt the OS regains control and assigns the processor to another user, is _____

A

time slicing

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

An example of a hardware feature that is desirable in a batch-processing system is:

A

privileged instructions

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

Which statement about multiprogramming is wrong?

A

Multiprogramming means several jobs can be on a single processor at a point of time.

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

_____ provide(s) an interface to the services provided by an operating system.

A

System calls

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

The two basic types of processor registers are:

A

User-visible and control/status registers

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

Small, fast memory located between the processor and main memory is called:

A

Cache memory

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

The _____ routine determines the nature of the interrupt and performs whatever actions are needed.

A

Interrupt handler

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

_____ refers to the tendency for a processor to access memory locations that have been used recently, therefore the performance can be improved by cache. For Example, when an iteration loop is executed, the processor executes the same set of instructions repeatedly.

A

Temporal Locality

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

_____ is more efficient than interrupt-driven or programmed I/O for a multiple-word I/O transfer.

A

Direct memory access

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

What component is considered to be the cache of hard disk?

A

real memory

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

The four main structural elements of a computer system are:

A

Processor, Main Memory, I/O Modules, System Bus

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

Multitasking in a computer with only one CPU is accomplished by a technique called

A

multiprogramming

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

Mean time to failure (MTTF) can be seen as average _____.

A

uptime

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

Apple’s Mac OS X is based on

A

FreeBSD UNIX

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

To allow for programs to access and execute operating system instructions, operating systems provide _____.

A

system calls

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

Linux kernel is classified as

A

monolithic kernel

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

A microkernel is a kernel _____.

A

that is stripped of all nonessential components

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

Key to the success of Linux has been it’s character as a free software package available under the auspices of the:

A

Free Software Foundation

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

Most UNIX systems are _____, in that they include virtually all of the O/S functionality in a single large block of code that runs in a single process with a single address space.

A

monolithic

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

_____ assigns a processor to the first process in the ready queue.

A

Dispatching

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

A(n) _____ is a set of instructions to be executed in response to a certain type of interrupt.

A

interrupt handler

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

An operating system must be designed such that _____.

A

context switches are transparent to processes

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

What operation is particularly useful for detecting security threats and debugging software?

A

suspend

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

How many processes truly execute concurrently in a system at any time?

A

at most as many as there are processors

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

A process may transition to the Ready state by which of the following actions?

A

all of the above (completion of an IO event, newly-admitted process, selected by the dispatcher)

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

A process control block ____.

A

includes information on the process’s states

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

The _____ refers to the number of processes in memory.

A

Degree of multiprogramming

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
51
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
52
Q

The list of processes waiting for a particular I/O device is called a(n) _____.

A

event queue

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

The operating system acts as an interface between the computer hardware and the human user.

A

TRUE

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

A fetched instruction is normally loaded into the Instruction Register (IR)

A

TRUE

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

User-visible registers are typically accessible to system programs but are not typically available to application programs.

A

FALSE

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

One of the processor’s main functions is to exchange data with memory.

A

TRUE

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

An interrupt is a mechanism used by system modules to signal the processor that normal processing should be temporarily suspended.

A

TRUE

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

One of the driving forces in operating system evolution is advancement in the underlying hardware technology

A

TRUE

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

An operating system controls the execution of applications and acts as an interface between applications and the computer hardware.

A

TRUE

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

Time-Sharing Systems is designed to maximize response time

A

FALSE

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

RAID Disks are classified as what kind of fault tolerance method?

A

Information redundancy

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

The text segment of a process address space contains:

A

the executable code associated with the process

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

For a single processor system, _____ (choose the best answer)

A

there will never bw more than one running process

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

Which of the following states is not a discrete process state?

A

unblocked state

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

In the Five-State Process model, the following represents a valid state transition:

A

Running -> Blocked

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

The scheduling strategy where each process in the queue is given a certain amount of time, in turn, to execute and then returned to the queue, unless blocked is referred to as:

A

Round-Robin

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

The Process Image element that contains the collection of attributes needed by the O/S to control a particular process is called the:

A

Process Control Block

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

When one process spawns another, the spawned process is referred to as the _____.

A

child process

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

The portion of the operating system that selects the next process to run is called the _____.

A

dispatcher

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

The state transition from READY to RUNNING happens when a process _____

A

is dispatched by the scheduler

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

the concept of a process in an operating system embodies two primary characteristics, one of which is:

A

Resource Ownership

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

In a Linux system, when a new process is cloned, two processes share the same

A

Virtual Memory

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

*In Linux, the state of a task will be ____, if it is blocked, waiting directly on hardware conditions and not handle any signals.

A

Uninterruptible

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

Threads in user space can be more appropriate than kernel thread because ____.

A

All of the above (Application developers can tune the threading library’s scheduling algorithm to meet the needs of specific application, user-level thread do not require the operating system to support threads, user-level threads do not invoke the kernel for synchronization, which can reduce overhead)

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

Which of the following statements about kernel-level threads is false?

A

Software that employs kernel-level threads often is more portable than software that employs user-level threads

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

Which type of components Android Applications corresponds to a single screen as a UI?

A

Activities

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

Which of the following placement algorithms is considered to be the best and fastest?

A

First

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

____ temporarily removes a process from main memory to allow another process to make use of the system’s resources.

A

Swapping

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

____ strategies determine which pieces of data to remove from main memory to free space for a new process.

A

Replacement

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

Which of the following statements is false?

A

Real memory management is unimportant in today’s systems.

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

The chunks of a process are known as ____.

A

pages

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

Available chunks of memory are known as ____.

A

frames

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

A ____ is a particular example of logical address in which the address is expressed as a location relative to some other point, usually a value in a processor register.

A

Relative Address

84
Q

the practice in which a program and data are organized in such a way that various modules can be assigned the same region of memory is called overlaying.

A

TRUE

85
Q

Segmentation has a number of advantages to the programmer over a non-segmented address space, including:

A

All of the Above (sharing among processes, protection, simplifying the handling of growing data structures)

86
Q

____ is the virtual storage assigned to a process.

A

Virtual Address Space

87
Q

A ____ is issued if a desired page is not in main memory

A

page fault

88
Q

The ____ determines when a page should be brought into main memory

A

fetch memory

89
Q

Which of the following statements about virtual memory is NOT true?

A

all pages of a process reside in main memory simultaneously

90
Q

What statement is correct about the difference between a program and a process

A

program is passive

91
Q

Which one describes multiprogramming most correctly

A

it could happen that no program actually complete for a period of time

92
Q

Among the mechanisms for interrupting the execution of a process, what is used for the reactions to an asynchronous external event

A

interrupt

93
Q

The queues of processes are implemented as

A

linked lists

94
Q

For the 7 state process model of Figure 3.9b in the textbook, what is the state of a process has is not waiting for an I/O event to occur and is not in memory

A

ready/suspend

95
Q

During dispatcher saves the state of the currently running process and restores the state of the next process to run

A

context switch

96
Q

For the process model with 7 different states, the state of process with PID 121 is currently blocked/suspend. Before the I/O event occurs, some processes are completed, and dispatcher loads the PID 121 process into memory, what will be its new state

A

Blocked

97
Q

What could be the next state of a running? A:exit b:ready c:blocked d:new e:blocked/suspend

A

A,B,C, only

98
Q

which of the following is not a role of a typical operating system

A

assist the computer user in the task of processing digital photographs

99
Q

The portion of the Process Control Block that consists of the contents of the processor registers is called the Process Control Information

A

FALSE

100
Q

In a simple batch system is used to prevent a single job from monopolizing the system. If it expires, the user program is stopped, and the control returns to the monitor

A

Timer

101
Q

Hardware features desirable in a batch processing operating system include memory protection, timer, privileged instructions, and

A

interrupts

102
Q

The operating systems refers to its inherent flexibility in permitting functional modifications to the system without interfering with service

A

ability to evolve

103
Q

In a SMP system, availability is improved because

A

the failure of a single processor does not halt the system

104
Q

Which statement about cache memory is not true

A

cache memory is managed by the OS so the LRU replacement policy can be implemented

105
Q

Interrupt-driven I/O is more efficient that simple programmed I/O, and it requires the use of the to transfer data between memory and I/O module

A

CPU

106
Q

In traditional UNIX systems, how a new process is created

A

kernel issues a system call fork()

107
Q

Which of the following statements the simple batch systems is true

A

-operator batches the jobs together sequentially

108
Q

-each program is constructed to branch back to the monitor when it completes processing

A

-the user no longer has direct access to the processor

109
Q

Mean time to repair (MTTR) can be seen as average

A

downtime

110
Q

Which of the following techniques can be incorporated into OS software to support fault tolerance

A

process isolation

111
Q

virtual machines seem to be the best solution to solved problems such as

A

legacy applications

112
Q

-interrupt processing

A

-device drivers

113
Q

an example of a hardware feature that is desirable in a batch processing system is

A

privileged instructions

114
Q

handled in strict sequential order, all interrupts are stopped while an interrupt is processed. In this case, after the interrupt-handler routine completes, interrupts are reenabled before resuming the user program.

A

TRUE

115
Q

When a processor needs to access memory, it will stop DMA by sending an interrupt signal.

A

FALSE

116
Q

The two basic steps used by the processor in instruction processing are

A

Fetch and Execute cycles

117
Q

As one proceeds down the memory hierarchy the following condition(s) apply

A

Increasing access time

118
Q

The _____________ holds the address of the next instruction to be fetched

A

Program Counter (PC)

119
Q

The ___________ chooses which block to replace when a new block is to be loaded into the cache and the cache already has all slots filled with other blocks.

A

replacement algorithm

120
Q

The L2 Cache of Intel Core i7 processor is

A

On the processor chip, one L2 cache dedicated to core

121
Q

In multiprocessor environments, two copies of the same data may reside in the local cache of each CPU. Whenever one CPU alters the data, the cache of the other CPU must receive an updated version of this data. This is called Cache ___________

A

Coherency

122
Q

Which of the following memory (storage) component is most frequently used as an approach to save data off-site (not in the data center)?

A

Magnetic tapes

123
Q

A computer has a cache, main-memory, and disk used for virtual memory. If a referenced word is in the cache, 20 ns are required to access it. if it is in main memory but not in the cache, 60 ns are needed to load it into cache. When the data needed is not needed in cache but in memory, what is the total access time?

A

80 ns

124
Q

In a Simple Batch System, ______________ is used to prevent a single job from monopolizing the system. If it expires, the user program is stopped and control returns to the monitor.

A

Timer

125
Q

In an SMP system, “availability” is improved because

A

The failure of a single processor does not halt the system

126
Q

The operating system’s ____________ refers to its inherent flexibility in permitting functional modifications to the system without interfering with service.

A

ability to evolve

127
Q

The operating system provides many types of services to end-users, programmers, and system designers, including

A

Error detection and response

128
Q

Hardware features desirable in a batch-processing operating system include memory protection, timer, privileged instructions, and _________

A

interrupts

129
Q

Which statement about multiprogramming is wrong?

A

Multiprogramming means several jobs can be on a single processor at a point of time.

130
Q

What is the purpose of system call?

A

Invoke a function provided by the operating system, transfer to a system program that runs in kernel mode.

131
Q

The two basic types of processor registers are

A

User-visible and Control/Status registers

132
Q

A control/status register that contains the address of the next instruction to be fetched is called the:

A

Program Counter (PC)

133
Q

Interrupt driven I/O, although more efficient than simple Programmed I/O, still requires the use of the ____________ to transfer data between memory and an I/O module

A

CPU

134
Q

Small, fast memory located between the processor and main memory is called:

A

Cache memory

135
Q

The ______________ routine determines the nature of the interrupt and performs whatever actions are needed.

A

interrupt handler

136
Q

____________ refers to the tendency for a processor to access memory locations that have been used recently, therefore the performance can be improved by cache. For example, when an iteration loop is executed, the processor executes the same set of instructions repeatedly.

A

Temporal locality

137
Q

_____________ is more efficient than interrupt-driven or programmed I/O for a multiple word I/O transfer

A

Direct memory

138
Q

What component is considered to be the cache of hard disk?

A

real memory

139
Q

The four main structural elements of a computer system are:

A

Processor, Main memory, I/O modules, System bus

140
Q

What is the problem of I/O process without interrupt, compared to the one with interrupt?

A

Waste CPU cycles to periodically check the status of I/O devices

141
Q

Multitasking in a computer with only one CPU is accomplished by a technique called

A

Multiprogramming

142
Q

Mean time to failure (MTTF) can be seen as average __________.

A

uptime

143
Q

To allow programs to access and execute operating system instructions, operating systems provide ________.

A

System calls

144
Q

Linux kernel is classified as

A

monolithic kernel

145
Q

A microkernel is a kernel

A

that is stripped of all nonessential components

146
Q

Most UNIX systems are _____, in that they include virtually all of the O/S functionality in a single large block of code that runs in a single process with a single address space.

A

monolithic

147
Q

_________ assigns a processor to the first process in the ready queue

A

Dispatching

148
Q

A(n) ____________ is a set of instructions to be executed in response to a certain type of interrupt.

A

interrupt handler

149
Q

An operating system must be designed such that

A

context switches are transparent to processes

150
Q

What operation is particularly useful for detecting security threats and debugging software?

A

suspend

151
Q

How many processes truly can execute concurrently in a system at any time?

A

at most as many as there are processors

152
Q

A process may transition to the Ready state by which of the following actions?

A

Completion of an IO event, newly admitted process, selected by the dispatcher

153
Q

A process control block ____________

A

includes information on the process’s state

154
Q

The ______________ refers to the number of processes in memory

A

degree of multiprogrammign

155
Q

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

A

stack

156
Q

The list of processes waiting for a particular IO device is called a(n) _______________

A

event queue

157
Q

Program counter (PC)

A

contains the address of the next instruction to be executed

158
Q

Instruction register (IR)

A

The register that contains the instruction currently being executed opcode + address of data

159
Q

Memory Address Register (MAR)

A

specifies the address in memory for the next read or write; holds address of the data

160
Q

Memory Buffer Register (MBR)

A

contains the data to be written into memory or receives the data read from memory

161
Q

Accumulator (AC)

A

intermediate ALC results are stored temporarily

162
Q

baby kill my good teaching practices

A

byte, kilo, mega, giga, tera, peta

163
Q

starvation

A

a runnable process is overlooked indefinitely by the scheduler. even though it can run, it is never chosen

164
Q

deadlock

A

situation in which 2 or more process are unable to proceed because each is waiting for one of the others to do something

165
Q

What is the difference between deadlock and starvation?

A

With deadlock, you are bound to never execute a process. With starvation, there’s a chance that you can complete it.

166
Q

process

A

a program in execution. an infinite number of processes exist at once. made of multiple threads.

167
Q

running

A

process is currently executing. one process can in be this state at a time

168
Q

ready

A

process is prepared to execute when given opportunity

169
Q

blocked/waiting

A

a process that cannot execute until some event occurs (ie I/O completion)

170
Q

new

A

process that’s been created but not admitted to the pool of executable processes by the OS. still in the disk (not in main mem)

171
Q

exit

A

process that’s been released from the pool of executable processes because it completed or aborted

172
Q

null -> new

A

a new process is created to execute a program

173
Q

new -> ready

A

os will move a process from new to ready when it is prepared to take on an additional process

174
Q

ready -> running

A

scheduler chooses one of the ready processes to run

175
Q

running -> exit

A

currently running process is terminated if completed or aborted

176
Q

running -> blocking

A

process request something it must wait for

177
Q

blocked -> ready

A

when the event the process was waiting for occurs

178
Q

ready -> exit

A

parent terminates a child process, or parent terminates and consequently all children terminate

179
Q

blocked -> exit

A

I/O operation fails and error occurs. Or process has been waiting for I/O for too long and terminates

180
Q

blocked/suspend

A

in secondary memory waiting on an event

181
Q

ready/suspend

A

in secondary memory but ready for execution as soon as there’s space in main mem

182
Q

blocked -> blocked/suspend

A

If there’s no ready process, then at least one blocked process is swapped to make room for another that is ready

183
Q

blocked/suspend -> ready/suspend

A

when the event it was waiting for occurs

184
Q

ready/suspend -> ready

A

no ready process in the main memory so OS brings in this process that is ready to be executed

185
Q

new -> ready/suspend

A

the main memory read processes have higher priority

186
Q

blocked/suspend -> blocked

A

1) a process in the blocked/suspended queue has a higher priority than any process in the ready/suspended queue 2) OS believes whatever event the process was waiting for is going to occur soon

187
Q

running -> ready/suspend

A

OS preempting the process bc a higher priority process in the blocked/suspended queue became unblocked; freeing some main memory

188
Q

mode switching

A

user mode to kernel mode kernel mode to user mode

189
Q

process switching

A

may occur anytime the OS has gained control from currently running process

190
Q

threads

A

smaller processes

191
Q

mutual exclusion

A

when one process is in a critical section using a resource, no other process may be in the critical section

192
Q

Difference between busy waiting and blocked

A

Still on CPU wasting cycles = Busy waiting Not on CPU = blocked

193
Q

√First Attempt

A

Global Variable = Turn
If the turn = num of the process, that process can move into the critical section.
otherwise, the process will repeatedly read the turn variable until it’s its turn.
after the process is done with its critical section, it’ll update the turn variable.

/process 0/
var turn;
while (turn != 0){
do nothing
}
/cs/
turn = 1;

Disadv: busywaiting, pace of execution is dictated by the slower process, and if one process fails in the CS, other process is permanently blocked

194
Q

Second Attempt

A

Difference between 1st and 2nd:
-1st only stores turn. 2nd stores state info about both processes.
-worse than 1st attempt because mutual exclusion isn’t satisfied

each process checks the other’s flag but can’t alter it.
others check each other’s flags when they want to enter their own CS.
If the other process is false, they can enter their own CS.
flag[0] = false means P0 isn’t in its CS.
if other’s flag is false, the process changes its flag to true and enter CS.
After its done in the CS, it changes it’s flag back to false.

/P0/
while (flag[1] = true){
do nothing
}
flag[0] = true;
/cs/
flag[0] = false;

disadv: if a process fails inside the CS or after setting flag to true, the other process is permanently blocked

195
Q

Third Attempt

A

Difference between 2nd and 3rd:
-3rd sets the flag at the start of the code

/p0/
flag[0]=true;
while(flag[1]=true){
do nothing;
}
/cs/
flag[0]=false;

disadv: if a process fails inside the CS, the other process is permantently blocked. deadlock: both processes set flags to true before either has executed the while statement, then each will think that the other has entered it’s CS

196
Q

Fourth Attempt

A

Difference between 3rd and 4th:
-3rd, each process sets its state without knowing the state of the other
-4th fixes this by making each process more deferential. each process sets its own flag to indicate it wants to enter CS, but uses a delay and is prepared to defer to the other process

/P0/
flag[0]=true;
while(flag[1]=true){
flag[0]=false;
delay;
flag[0]=true;
}
/cs/
flag[0] = false;

disadv: livelock (look at sequence)

197
Q

Fifth Attempt

A

Difference between 4th and 5th:
impose an order on the activities of the 2 processes to avoid mutual courtesy combine turn and flag

198
Q

Instruction Cycle with MAR and MBR

A

Fetch
1) start with the PC value
2) copy the PC value into MAR
3) MBR = whatever value is at the address of MAR
4) copy the MBR value into IR
5) Execute IR

199
Q

Banker’s Algorithm

A

1) sum of each resource in the allocation matrix
2) total resources available for each resource - sum of each resource from prev step = available matrix
3) need matrix = maximum - allocation
4) if need <= available, execute. available = available + allocation
5) else, move ahead

200
Q

Resource Request Algo with 1 request

A

1) if request <= need, move to step 2
2) if request <= available, move to step 3
3) available = available - request
allocation = allocation + request
need = need - request
4) Redraw matrices
5) then apply Banker’s

201
Q

Resource Request Algo with 2 requests at the same time

A

1) total the request of p1 and p2
2) total the need of p1 and p2
3) if total request <= total need, move to next step
4) if total request <= total available, move to next step
5) available = available - total request
allocation = allocation + respective/individual request
need = need - respective/individual request
6) redraw matrices
7) then apply Banker’s

202
Q

race condition

A

when multiple processes or threads read and write data items so that final results depends on the order of execution of instructions in multiple processes

203
Q

semaphore

A

global integer value/variable used for signaling among processes; decides which process gets access to critical section

204
Q

3 Operations of Semaphores

A

1) Can be initialized to a nonneg int
2) semWait decrements sem value; if value < 0, process executing semWait is blocked. Otherwise, process continues execution
3) semSignal increments sem value; if value <= 0, then process blocked by semWait is unblocked

205
Q

Counting Semaphore Code

A

wait(s){
while(s <= 0){ //process blocked
do nothing
}
s–;
}
signal(s){
s++
}