Posts

Showing posts from November, 2024

CST 334 Week 5

This week I focused on concurrency and how threads operate within a program. In the lab, I worked on a program that demonstrated how using the same variable across multiple threads can lead to issues, such as unexpected behavior and incorrect outputs. This highlighted the challenges of managing shared state in concurrent programming and the importance of addressing these problems effectively. Alongside the lab, I studied thread APIs, locks, and synchronization, which are key tools for controlling thread behavior and preventing issues like race conditions. These concepts helped me understand how to coordinate threads to ensure that programs run smoothly and reliably. Overall, this week gave me a solid understanding of the complexities of concurrency and how to handle them using the right techniques.

Week 4 CST 334

This week, I focused on understanding memory virtualization and its role in operating systems. I explored various techniques such as segmentation, paging, and swapping. Segmentation organizes memory into logical sections like code and data, which works well for modular programs, though it can lead to external fragmentation. Paging, on the other hand, divides memory into fixed-size pages, minimizing gaps but potentially causing internal fragmentation when pages are underutilized. I also learned about segmented paging, a hybrid approach that combines the benefits of both methods but adds complexity. Additionally, I studied swapping, where the system moves data between RAM and disk to handle memory shortages. However, excessive swapping can lead to thrashing, significantly degrading system performance. It was fascinating to see how these techniques work together to optimize memory management. In the lab, I implemented a FIFO (First-In-First-Out) page replacement algorithm to study the...

CST 334 Week 3

This week, I got into memory virtualization and learned a lot about how operating systems handle memory. I covered things like address spaces, the Memory API, address translation, and segmentation. Each concept helped me understand how the OS keeps processes isolated and organized in memory. Address spaces and segmentation, in particular, showed me how the OS keeps different processes from interfering with each other by giving each one its own memory space. I also spent time with Linux commands like grep, sed, and awk and got into using regex in bash. Since I’ve worked with regex in Java before, it was fun to see it in action on the command line. Regex makes text processing really efficient, and using it alongside grep and sed made sorting through files a lot easier.  On the coding side, I worked with inter-process communication (IPC) in C, mainly using pipes, and practiced using Makefiles to keep everything organized. Using fork() and exec(), I could create child processes that ru...

CST334 Week 2

This week, I got deeper into C programming and learned a lot about handling processes and using Makefiles to keep things efficient. I worked with fork() to create child processes that run alongside the parent process, each doing its own thing but starting from the same code. It was cool to see how exec() lets the child process switch over to something entirely different (like running ls), and using wait() in the parent kept everything orderly by ensuring the parent only moved on after the child finished. I also set up a Makefile, which made compiling the programs way easier. With just a few commands in the Makefile, everything compiles automatically, and I can clean up with a single command too. Makefiles are a big help for keeping things neat and organized, especially with multiple files. Overall, this week was a solid intro to process management in C, plus some useful tricks to streamline the whole coding workflow!