1/52
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Program Counter (PC)
Points to the NEXT instruction to execute, acting like a bookmark for code execution.
Stack Pointer (SP)
Points to the top of the process's stack, holding function calls, local variables, and return addresses.
PSW/FLAGS Register
Status flags indicating results of last CPU operation, used in decisions like if statements and loops.
Pseudoparallelism
Fake simultaneous execution where the CPU switches between processes rapidly, giving the illusion of concurrency.
Multiprogramming
Multiple programs loaded in memory that use the CPU while one is waiting for I/O.
Copy-on-Write
Memory sharing technique where parent and child processes share pages until one tries to write.
Context Switch
The process of saving the current state of one process and loading the state of another.
Critical Region
Code section that accesses shared resources, limiting to one process execution at a time.
Mutual Exclusion
Only ONE process may be in the critical region at one time, preventing race conditions.
Race Condition
Output dependency on the timing of execution, making it unpredictable and hard to debug.
Spin Lock
A loop that repeatedly checks if a lock is free, wasting CPU cycles on short waits.
Semaphore
An integer counter used to manage resources, blocking processes when necessary.
Kernel
The core of an OS that has full control over hardware and software interactions.
Kernel Jobs
Includes process management, memory management, device management, file system, and scheduling.
Program
Static code on disk, representing a set of instructions that can be executed.
Process
An executing program that comprises code, data, and the current CPU state.
Thread
A lightweight unit of execution within a process, sharing resources but with individual stacks.
Process State: READY
The process is prepared to run and is waiting for CPU allocation.
Process State: RUNNING
Refers to the current process actively executing on the CPU.
Process State: BLOCKED
The process is unable to proceed, typically waiting for I/O or events.
READY to RUNNING
Transition initiated by the scheduler for a process to begin its execution.
RUNNING to READY
Occurs when a time slice expires or a higher priority process preempts execution.
RUNNING to BLOCKED
The process voluntarily waits for resources like I/O or a semaphore.
BLOCKED to READY
Occurs when the event a process is waiting for has occurred.
Context Switch Steps
Process of switching contexts includes saving registers, updating state, and restoring the new process.
Bad Context Switch Problems
Can lead to race conditions, corrupted variables, and inconsistent data if mishandled.
Process Abstraction
Perception by the OS that each process owns the entire system, ensuring memory protection.
Thread Abstraction
Involves multiple execution paths within a process, allowing efficient resource sharing.
Process Table (proctab)
Array used to manage processes, indexed by their PID for quick access.
Current Process
Accessed using the variable currpid to determine the PID of the running process.
Ready List
Queue containing all processes in the READY state waiting for CPU allocation.
Semaphore in Xinu
Comprises a count for resources and a queue for waiting processes.
wait() Operation
Decrements semaphore count and blocks the process if count goes negative.
signal() Operation
Increments semaphore count and may wake a waiting process if count is non-positive.
Semaphore Count Meaning
Indicates resource availability. Positive = available, Negative = number of waiting processes.
If it’s negative, that many processes are waiting to run (blocked).
If it’s positive, there are available resources, and no processes are blocked.
receive()
A blocking operation for message reception, waiting indefinitely if no message is present.
recvclr()
A non-blocking message receive that returns immediately if no message is available.
recvtime()
Message reception that includes a specified timeout period for waiting.
Killing SLEEPING Process
Involves removing the process from the sleep queue to avoid crashes.
Killing READY Process
Requires removal from the ready list to prevent attempts to run a dead process.
Killing WAITING Process
Involves removing it from the semaphore queue and handling semaphore increments.
Process Entry Fields
Includes essential fields like Name, Priority, PID, and State for each process.
Invariants
Rules maintaining consistency of states in process queues and current process handling.
User-Level Threads
Thread management by a library, with the kernel recognizing only one process.
Kernel-Level Threads
Managed by the kernel with independent scheduling, allowing concurrency across CPUs.
fork() Function
Creates a duplicate of the calling process, allowing concurrent execution with distinct return values.
Atomic Action
Operations that complete without interruption, ensuring integrity in execution.
Why Race Conditions Hard to Debug
Due to their timing-dependent nature, making non-reproducible outcomes likely.
Spin Lock vs Semaphore
Spin lock wastes CPU on short waits, while semaphores block processes, saving CPU.
Blocking and I/O
I/O operations put processes into BLOCKED state, allowing CPU multitasking.
Preemption
Higher priority processes can interrupt and take over the running process.
Quantum (Time Slice)
The maximum duration a process can run before being interrupted for scheduling fairness.
Priority Scheduling
Organizes the ready list by process priority, allowing critical tasks precedence.