Posts

Showing posts from April, 2025

CST 334 Week 8

  3 important topics I have learned about in this class are virtualization, concurrency, and persistence. Virtualization allows multiple processes or dynamic instances of a running program to run in parallel, even on single processor systems. To accomplish this, the OS virtualizes physical memory, which provides the process its own address space, and controls its use of the CPU through context switching. In this class, I learned about several memory allocation techniques such as paging and segmentation as well as different scheduling algorithms such as using multilevel feedback queues scheduling. Concurrency is essential in the execution of multiple threads, the most basic unit of execution of a process. Issues can occur when multiple threads attempt to enter access and manipulate shared data. Race conditions and inconsistent program results can occur if the order in which threads enter a critical section is not regulated. To ensure atomicity, synchronization primitives such as loc...

CST 334 Week 7

The first topic I learned about this week was how devices connect to the computer system. In modern computer architecture, devices such as external storage devices, keyboards and monitors connect to the CPU via an IO chip. Each device that connects to the system provides an interface, allowing the system software to interact with it. This interaction between the device and system can also be improved by Interrupt based techniques or direct memory access. This topic led to my introduction into hard disk drives. These are rotating disks that store data in tracks by inducing magnetic changes. Writes and reads to the disk are performed by the disk head that is attached to a disk arm. Work loads can be sequential (data manipulated is in consecutive sectors) or they can be random (data being manipulated is in scattered locations across the disk). Disk scheduling (SCAN, SPTF, and SSTF) greatly impacts the cost of IO, but unlike process scheduling, it is easier to estimate the length of execut...

CST 334 Week 6

During this week of class, I spent most of my time learning about semaphores. A semaphore is a synchronization primitive that can be used either as a lock or a condition variable. It consists of an int value and this value plays a significant role in how it can be used for synchronization. There are several semaphore management routines, but the routines discussed in this week’s reading assignment are sem_wait and sem_post. Sem_wait, decrements the value of the semaphore and waits to see if the value is negative and sem_post increments the value and wakes a waiting thread if there is a negative semaphore. An example discussed creates a lock using a semaphore initialized to 1. When sem_wait is first called, the thread that calls it does not have to wait since the semphore’s value is not negative (sem val = 0). If or when another thread calls sem_wait, it must wait (since sem val is now negative) until the first thread calls the function sem_post. Once the original thread calls sem_post,...

CST 334 Week 5

The 2 main ideas I learned about this week were concurrency and threads. Threads are units of a single running process, sharing the same address space and data. Using multiple threads helps prevent programs from being blocked by input and output and allows for parallelism, which allows the program to run on multiple processors. Despite its benefits, issues can arise when data becomes inconsistent from multiple threads updating the same data. This dilemma introduces the idea of concurrency, the next major topic I learned about. Within the topic of concurrency, I learned about critical sections of code, which are lines of code that use variables shared by other threads. Next, I learned about race conditions, which is when threads attempt to read or write the same data. This can occur when threads enter the same critical section at the same time and can result in an indeterminate program. An indeterminate program is a program that produces inconsistent results despite having the same inpu...