This is aimed to deepen my knowldge in the theoritical aspect of comsci programming and comp archetecture.
Last updated 8:13 PM on 6/13/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
No analytics yet
Send a link to your students to track their progress
13 Terms
1
New cards
What does 'concurrency' mean in a single-core processor?
It is the illusion of simultaneous execution, created by the OS rapidly alternating CPU access between different tasks.
2
New cards
What happens when a process or thread needs to wait for an I/O resource (like reading a hard drive)?
The task enters an 'interruptible sleep' state, and the CPU instantly switches to another ready task to avoid sitting idle.
3
New cards
What is a Process Control Block (PCB) or task_struct?
It is the low-level, physical snapshot the OS keeps in memory, tracking exact CPU state, registers, flags, and the program counter for a specific task.
4
New cards
How do you view a high-level summary of all running PCB snapshots in the Ubuntu CLI?
By running the command 'ps aux', or using dynamic monitors like 'top' and 'htop'.
5
New cards
What does the PID 1 process represent in a Linux OS?
It is the ultimate parent process (systemd or init) that spawns all other processes and mostly sleeps while listening for critical system events.
6
New cards
How can you view the exact sequence of kernel function calls where a process is currently paused?
By reading the virtual file at '/proc/[PID]/stack' using the 'cat' command.
7
New cards
How do you redirect the output of a CLI command like 'cat' to save it directly into a text file?
By using the '>' operator to overwrite a file, or '>>' to append to it.
8
New cards
Why is context switching between entirely different processes slow?
Because it requires tearing down the entire memory map and flushing the hardware cache (TLB).
9
New cards
What is the primary advantage of threads over traditional processes?
Threads within the same process share the same memory address space, allowing context switches without flushing the memory cache, making them drastically faster.
10
New cards
What happens if you create too many active threads (e.g., 100 threads on a 4-core CPU)?
You trigger 'Thread Thrashing', where the CPU wastes most of its time performing the overhead of context switching rather than executing actual program instructions.
11
New cards
How does Node.js achieve high performance using only a single thread?
It uses an Event Loop and Asynchronous, Non-Blocking I/O, meaning the single thread delegates slow tasks to the OS and never waits, completely avoiding context-switching overhead.
12
New cards
What problem did traditional Java (Platform Threads) face when handling massive concurrency?
It used a 1:1 mapping with OS hardware threads, leading to severe memory exhaustion and catastrophic context-switching overhead under heavy load.
13
New cards
How do Java 21 Virtual Threads (Project Loom) solve the 1:1 OS thread bottleneck?
They use an M:N mapping model; when a Virtual Thread hits a blocking I/O operation, the JVM instantly 'unmounts' it from the physical OS Carrier Thread and parks it cheaply in the JVM Heap, freeing the OS thread immediately.