Final pt 2

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

1/67

flashcard set

Earn XP

Description and Tags

Last updated 6:09 PM on 12/3/22
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

68 Terms

1
New cards
Shared Memory Interprocess Communication Pros/Cons
Pros:
-Fast Speed/Communications

Cons:
-Protection / Syncing Processes has issues
2
New cards
Message Passing Interprocess Communication Pros/Cons
Pros:
-In a distributed system it's easier to implement than shared memory interprocess communication, no conflicts

Cons:
-Longer to implement because kernel intervention
- Once implemented, can only transfer small amounts of data
3
New cards
Microkernel Approach: Overview & Pros/Cons
Overview:
OS Structure which minimizes processes in kernel by placing them in user mode.

Pros:
- Minimizing processes in Kernel Mode makes OS more secure
- Less shared global variables that could potentially cause OS complications if used incorrectly.

Cons:
- Lots of context switching and interprocess communication can it make inefficient
4
New cards
How many processes are created by the following code?

int main() {
fork();
fork();
return 0;
}
4.

[Parent]
_______
[Parent] [1] //fork 1, 'parent' creates '1'
_______
[Parent] [1] [2] [3] //fork 2, 'parent' creates '2', '1' creates '3'
5
New cards
​Describe​​ the ​​actions ​​taken ​​by ​​a ​​kernel ​​to ​​context-switch​​between​ ​processes P1->P2
1. P1's PCB is saved
2. P2's PCB is retrieved
6
New cards
Short Term vs Long Term Scheduler
Short Term (AKA CPU Scheduler):
- Decides what process to be executed next
- Allocates CPU

Long-Term (AKA Job Scheduler):
- Selects which processes should be brought into the ready queue
7
New cards
Types of Processes (2)
I/O-Bound Process:
- Predominantly does I/O work, short CPU Bursts

CPU-Bound Process:
- Does more computations, few but long CPU bursts
8
New cards
Important resources used when process is created (5)
-State
-Number
-Counter (location of next processes to execute)
-Stack
-Register
9
New cards
Resources used when a thread is created (2)
- Register
- Stack
10
New cards
Deadlock definiton
Prevent sets of concurrent processes from completing their tasks
11
New cards
Process Utilization Steps (3)
1. Request
2. Use
3. Release
12
New cards
4 conditions that cause deadlock
1. Mutual Exclusion: Only one process can use at a time
2. Hold and Wait: A process holding at least one resource is waiting to acquire additional resources held by another
3. No Preemption: A resource can be released only voluntarily by the process holding it, after that process has completed its task
4. Circular Wait: Resources waiting on each other in a manner that a circular dependency is created
13
New cards
Firmware
Program loaded at power-up/reboot that initializes all aspects of system
14
New cards
How does device controller inform CPU that it's finished it's operation?
Causing an interrupt - OS's are interrupt-driven
15
New cards
Caching
Copying information info faster storage system

Upon attempting to access this information, cache is checked first to see if information is there
16
New cards
Multiprocessor Advantages (3)
1. Increased Throughput (processes being executed simultaneously)
2. Economy of Scale
3. Increased Reliability
17
New cards
Multiprocessor Types (2)
Asymmetric - Each processor gets a specific task

Symmetric - Each processor performs all tasks
18
New cards
Essential OS Services (8)
- Program Execution
- I/O Operations
- File Systems
- Communication
- Resource Allocation
- Accounting
- Error Detection
- Protection/Security
19
New cards
Purpose of System-Call Interface
Maintains table of numbers associated with each system call, and invokes the desired system call in kernel mode depending on user application
20
New cards
Core Dump
File capturing memory of the process, generated upon application failure
21
New cards
Crash Dumb
File capturing kernel memory, generated when OS crashes
22
New cards
System Boot Overview
Bootstrap loader, stored in ROM or EEPROM locates the kernel, loads it into memory, and starts it.
23
New cards
Process States (5)
- New: being created
- Running
- Waiting: waiting for event to occur
- Ready: waiting to be assigned to a processor
- Terminated: has finished execution.
24
New cards
Program Counter
Processor Register that points to the next instruction to execute.
25
New cards
Procedure for switching between processes P1 and P2
P1's state is saved into PCB1.
P2's state is retrieved from PCB2.

vice versa occurs when switching back.
26
New cards
Scheduling Queues of Processes (3)
- Job Queue - Set of all processes in the system
- Ready Queue - Set of all processes in main memory, ready and waiting to execute
- Device Queues - Set of processes waiting for an I/O device
27
New cards
Producer/Consumer Problem
Producer and Consumer are sharing a buffer. Producer cannot add data to it if the buffer full, and consumer cannot consume data if the buffer is empty.
28
New cards
Is blocking message passing synchronous or asynchronous?
Synchronous:
Sending is blocked until message is received, receiver is blocked until a message is available.
29
New cards
Socket definition and structure
Endpoint for communication
161.25.19.8:1625

Loopback: Special Case of 127.0.0.1 which refers to system on which process is running.
30
New cards
Types of Sockets (3)
UDP - Connectionless (Data is sent, receiving end is not considered)
TCP - Connection-oriented (Send/Receive confirmation is important)
Multicast Socket - Data can be sent to multiple recipients
31
New cards
External Data Representation Types (2)
Big-Endian and Little-Endian
32
New cards
Amdahl's Law
speedup
33
New cards
Multithreading Techniques
- Many-to-one: Multiple user-level threads mapped to single kernel thread.
- One-to-one: Creating a user-level thread creates a kernel thread, however # of threads per process is restricted due to overhead
- Many-to-many: A lot of user-level threads mapped to a lot of kernel threads
- Two-level: Blends many-to-many and one-to=one
34
New cards
Implicit Threading Definition
Compiles and run-time libraries manage threads instead of programmers
35
New cards
Thread Pool Advantages (3)
1. Quicker to access pre-made thread
2. Number of threads can be bound by pool size
3. Task is not restricted by overhead like creating a thread pool, allows room for different strategies
36
New cards
Parallel Regions definiton
Blocks of code that can run in parallel
37
New cards
Thread cancellation options (2)
Async Cancellation: Terminates thread immediately

Deferred Cancellation: Periodically checks to see if thread can be cancelled, which is signified by the cancellation point
38
New cards
Upcall
Kernel notifying thread's library scheduler about events (i.e. when thread is about to block), and thread library decides what to do.
39
New cards
Atomic Instructions
Non-interruptable
40
New cards
Bounded Waiting
There exists a bound, or limit, on the number of times other processes are allowed to enter their critical sections after a process has made request to enter its critical section and before that request is granted.

Layman's terms: Each process gets a chance to enter the critical section at least once, to prevent starvation
41
New cards
Priority Inversion
Scheduling Problem when lower-priority process holds a lock needed by a higher-priority process.
42
New cards
Dining-Philosopher Problem&Solution
Problem:
- 5 Philosophers / 5 Chopsticks,
- Need 2 Chopsticks to eat

Solution:
- Make picking up chopsticks part of the critical section
- Have odd-numbered neighbors pickup left then right chopstick
- Have even-numbered neighbors pickup right then left chopstick

//Right Chopstick First
do {
wait(chopstick[i]);
wait(chopstick[(i+1)%5];

// critical section - eating

signal(chopstick[i]);
signal(chopstick[(i+1)%5];
} while (true)

//Left Chopstick First
do {
wait(chopstick[(i+1)%5];
wait(chopstick[i]);

// critical section - eating

signal(chopstick[(i+1)%5]);
signal(chopstick[i];
} while (true)
43
New cards
Banker's Algorithm
44
New cards
What is an Operating system?
Execute user programs and make solving user problems easier.
Make the computer system convenient to use.
Use the computer hardware in an efficient manner.

It is a resource allocator and a control program.
45
New cards
Kernel
Another name for the OS. The one program running on the computer at all times.
46
New cards
System Programs
Associated the the OS but not necessarily part of the kernel.
47
New cards
Bootstrap Program
Program loaded up at power on/reboot. Typically stored in ROM or EPROM. Generally know as firmware. Initializes all parts of the system. Loads OS and starts it.
48
New cards
Interrupt
When the CPU is interrupted, it stops what it is doing and immediately
transfers execution to a fixed location.
49
New cards
Interrupt Vector
It is a table of pointers to interrupt service routines. Vector of addresses is indexed by a unique device number, given with
the interrupt request, to provide the address of the interrupt service routine for the interrupting device.
50
New cards
Trap/Exception
Software generated interrupt
51
New cards
Polling
Also know as busy waiting. It is in a loop, reading the
status register over and over until the busy bit becomes clear.
52
New cards
System Call
Also called a monitor call. Request to the OS to allow user to wait for I/O completion. Six major categories: process
control, file manipulation, device manipulation, information maintenance,
communications, and protection.
53
New cards
Device-status table
contains entry for each I/O device indicating its type, address, and state
54
New cards
Storage Device Hierarchy (Fastest->Slowest)
Registers>Cache>Main Memory>SSD>HDD>Optical Disk>Magnetic Tapes
55
New cards
Caching
Information in use copied from slower to faster storage temporarily to be used directly from cache.
56
New cards
Direct Memory Access (DMA)
After setting up buffers, pointers, and counters for the I/O device, the device controller transfers an entire block of data directly to or from its own buffer storage to memory, with no intervention by the CPU. Interrupt only generated once per block to let driver know op is completed.
57
New cards
Asymmetric Multiprocessing vs. Symmetric Multiprocessing
Asymmetric: each processor is assigned a specific task.

Symmetric: each processor performs all tasks.
58
New cards
Clustered System
Multiple computers connected together that usually have a shared storage-area network (SAN).
59
New cards
Multiprogramming (Batch System)
One job is selected and run via job scheduling. When it has to wait on I/O, OS switches to another job.
60
New cards
Timesharing (Multitasking)
is logical extension in which CPU switches jobs so frequently that users can interact with each job while it is running, creating interactive computing.
61
New cards
Emulation
can allow an OS to run on non-native hardware.
62
New cards
Semaphore
A semaphore S is an integer variable that, apart from initialization, is
accessed only through two standard atomic operations: wait() and signal().
63
New cards
wait()
wait(semaphore *S) {
S->value--;
if (S->value < 0) {
add this process to S->list;
block();
}
}
64
New cards
signal()
signal(semaphore *S) {
S->value++;
if (S->value
65
New cards
mutex lock
Protect a critical section by first acquire() a lock then release() the lock. Requires busy waiting.
66
New cards
Amdahl's Law
Identifies performance gains from adding additional cores to an application that has both serial and parallel components.
67
New cards
Multithreading Models
Many-to-one, one-to-one, many-to-many.
68
New cards
Thread Local Storage (TLS)
allows each thread to have its own copy of data.