Posts

Showing posts from December, 2025

CST 334 - Week 7 Learning Journal

 This week the lectures better helped grasp how operating systems handle input/output and persistent storage. We covered topics such as differences between block and character devices, how hardware interfaces allow the OS to communicate with I/O devices, and how OS manages performance through concepts like hard drive transfer rates. I/O scheduling and RAID, file systems (abstractions, directories, links, volumes, mounts, design, and on-disk data structures). Understanding how these topics connect helped me understand that the OS acts as a middle layer that hides hardware complexity while still trying to optimize performance and reliability. The most challenging topics for me were hard drive performance calculations and some of the lower-level on-disk data structures. I understand the general ideas, like seek time, rotational latency and transfer time effect but I need more practice applying them to different workloads. The file system abstractions were my "aha" moment for the...

CST 334 - Learning Journal week 6

 How Semaphores Work: Semaphores are synchronization tools that control access to shared resources in a concurrent environment. A semaphore holds an integer value that represents the number of permits available. Process or threads can perform two main operations, wait - which decreases the semaphore and may block the thread if no permits are available, and signal - which increases the semaphore and potentially unblocks a waiting thread. Semaphores are coordinators, the coordinations prevents conflicts, race conditions and incorrect program behavior.  Pros and Cons of Semaphores vs. Other Synchronization Tools: Comparison of semaphores to other tools such as mutexes, condition variables and monitors -  Semaphores are flexible - they can enforce mutual exclusion and general resource counting which mutexes cannot, but semaphores can also be error-prone, because the programmer is responsible for correct ordering. Monitors encapsulate locking behavior into the language or libr...

CST 334 - Learning Journal Week 5

 This week we covered a bunch of topics: threads, pthreads functions, locks, race conditions, critical sections, condition variables and how hardware plays a role in making this all work. Concurrency - a way to let multiple parts of a program make progress at the same time, improving speed and responsiveness. Understanding the main pthreads was not to bad but the parameters were a bit confusing. It's easy to pass the wrong thing or forget that threads don't automatically share the context you expect them too. It is very important to remember that when a thread is run, you have to pass the arguments carefully or share data. Locks were a concept that is easier to grasp than threads. For locks we discuss race conditions, mutual exclusion and critical sections. This made it easier to understand that when two threads are run at the same time the output is generally different each time unless you add a mutex near the critical section which will fix it. Condition variables are still c...