Posts

Showing posts from April, 2026

cd week_seven

Journal Entry Week 7 This week we started looking at how computers actually deal with real-world stuff like disks and devices, and then ended up inside how file systems are built from scratch. Topics We Covered I/O Devices (how the OS talks to hardware) Types of devices (block vs. character/stream) Polling, interrupts, and DMA Device drivers Hard drives (structure + performance) Disk scheduling (SSTF, elevator/SCAN) Files and directories (what they actually are) Inodes and links (hard vs symbolic) File system implementation (vsfs, bitmaps, superblock, etc.) How file access actually works (step-by-step reads/writes) Explaining the Topics I/O devices are basically everything that lets the computer interact with the outside world—keyboard, disk, screen, etc. The OS doesn’t talk to them directly in a messy way—it uses a structured system with registers (status, command, data) to communicate. There are two main device types: Block devices (like hard drives) --> you can jump to any locati...

cd week_six

Journal Entry Week 6 Topics We Covered The main topics we covered were: Anderson-Dolan method Using locks and condition variables to make a normal class thread-safe State variables in concurrent code Why busy waiting is bad Why wait() is different from a normal loop Synchronization barriers with semaphores Reusable barriers Turnstile pattern with semaphores How semaphores compare to locks and condition variables Explaining the Topics The Anderson-Dolan method felt like a step-by-step recipe for taking a normal class and turning it into a thread-safe one. Instead of just randomly throwing locks into code and hoping it works, it gives a process: start with a normal design, add a lock, protect the methods, add condition variables, add signal or broadcast, and then add waits inside loops. I liked that because concurrency usually feels messy, and this made it feel more structured. State variables were also a big deal this week. What clicked for me is that they help describe w...

cd week_five

Journal Entry Week 5 This week we moved deeper into concurrency, and now it’s not just “threads exist,” it’s like “threads can absolutely destroy your program if you’re not careful.” At first, I thought threads were just about doing multiple things at once, but now I’m realizing it’s really about controlling that chaos so everything doesn’t break. Topics We Covered Threads and concurrency basics Thread creation (pthread API) Race conditions and critical sections Locks (mutexes) Condition variables Lock performance and implementations Concurrent data structures (counters, lists, queues, hash tables) Explaining the Topics Threads are basically multiple execution paths inside the same program. Instead of one thing happening at a time, you’ve got multiple things running and sharing memory, which is where things start getting tricky. The pthread API is how we actually create and manage threads.  pthread_create() starts a thread, and pthread_join() waits for it to f...