Posts

Showing posts from November, 2024

Week 29 - Concurrency, Multi-Threading, and Synchronization

This week we covered concurrency which refers to the execution of multiple threads or processes in overlapping time periods. Concurrency can optimize performance but it also introduces complexity. Processes with distinct memory spaces and threads that share memory within a process show different concurrency approaches. Threads are lighter in terms of of overhead compared to processes and that makes them ideal for tasks where multiple operations can occur concurrently without the heavy context switching drawbacks. I also learned about synchronization and how it’s critical for ensuring that concurrent operation don’t lead to errors like race conditions.  The lab this week introduced me to multi-threading and thread synchronization by using the pthread library in C. I got to understand the challenges with managing multiple threads and particularly when they share the same memory. I got to run a program that created ten threads, each was attempting to print and iteration number but the...

Week 28 - Exploring Virtual Memory and FIFO

 This week I reviewed virtual memory and its role in modern operating systems. Virtual memory is a powerful concept that allows processes to have more memory than is physically available. It enhances system efficiency and simplifies the programming process. I touched on concepts like paging, where both logical and physical memory are divided into fixed-sized blocks. Logical pages are mapped to physical frames through a structure called a page table. In this week’s lab, we covered the First-In-First-Out (FIFO) page replacement algorithm, which seems to be a crucial concept in operating systems. The goal of this lab was to simulate how FIFO works to manage memory efficiently and effectively on a system with limited resources. I was able to measure page faults and analyze how cache size affects performance. Understanding concepts like this are crucial for designing software that performs better under constrained conditions.

Week 27 - Memory Management

This week we focused on memory management and how the OS manages RAM to handle processes while ensuring efficiency. We covered concepts like First Fit, Best Fit and Worst fit for partition allocation and explored their strengths and drawbacks. The concept of logical memory versus physical memory was also covered. It’s interesting to see how partitions use base and limit registers to ensure that processes only access their allocated memory. The lab this week focused on implementing IPC using pipes in a Linux environment. I used system calls to create multi-process apps that use common shell commands. Even if memory space isn’t shared, processes can communicate effectively. This lab was a good practice working with system calls.

Week 26 - Process Management

     This week I learned about how processes interact and explored how to manage their execution. Our lab this week had us work with system calls like fork(), exec, wait(), and exit(). We wrote a program that created a child process using fork() so that we can run both the parent and child processes together. We also experimented with different delays between the outputs.      Additionally, I practiced using command line tools and using makefiles to automate build processes. I also got a look into the C to see how we can use system calls like exec() to replace the child processes’ context with a new program. I also observed how to properly synchronize parent-child processes with wait().      Aside from studying processes creation, concepts like multi-threading and scheduling were covered. This week’s content gave me a deeper understanding on how processes are made and managed, and how they behave in a Linux environment.