Posts

Showing posts from November, 2024

5th Week: CST 334

Image
Hello, hello! The holidays are coming, and Thanksgiving is finally here! This week’s module was on concurrency and threads. We learned the difference between processes and threads, noting that threads share the same address space but have their own program counters and stacks. We learned about thread APIs like pthread_create and pthread_join for thread creation and management. We also looked at issues that can occur with multithreaded processes, such as race conditions and solutions like locks and condition variables. Locks ensure mutual exclusion by preventing race conditions when threads access shared data. The book explained that race conditions can lead to indeterminate results, where outputs vary unpredictably, as we observed in Lab 5. We studied the section concurrent data structures, which explains how to solve race conditions and make data structures safe for multiple threads by using locks. Examples included synchronized counters, concurrent linked lists, and concurrent queu...

4th Week: CST 334

  Topic: Memory Virtualization Hello everyone,      In this week’s material we covered the idea of memory virtualization in detail like the ideas of free space management, paging, translations, page tables, swapping mechanism and swapping polices. One important thing I learned was understanding how memory is allocated dynamically using APIs for example malloc. This allows programs to allocate memory from the heap. The goals of memory allocators are to balance accuracy, speed, and efficiency while managing memory effectively.      But dynamic memory allocation causes an issue known as external fragmentation. This happens when free memory is divided into small, noncontiguous blocks that are too small to use effectively. A solution to the problem of external fragmentation is paging, which eliminates the issue by dividing virtual memory into fixed-sized units called pages. These pages are mapped to physical memory, which is divided into page frames, an...

3rd Week: CST 334

Hello everyone,     This week in CST 334, we were introduced to Memory Virtualization, which includes topics like Address Space, Memory API, Address Translation, and Segmentation. The concept of address space is important to memory virtualization because it allows the OS to maximize CPU and memory efficiency by partitioning memory and enabling multiple processes to run at the same time. Each process gets its own memory space which allows the OS to map addresses to bytes uniquely for each process. This helps maintaining isolation. Different methods can be used to virtualize memory, such as time sharing, static relocation, and dynamic relocation. Providing each process with its own address space the OS enables memory virtualization and supports multiprogramming where multiple processes can run concurrently. A process has different types of memory, such as static and dynamic. For dynamic memory, we need the Memory API, which allows us to allocate and deallocate memory a...

2nd Week: CST 334

 Hello everyone! This week we cover abstraction, process API, limited direct execution, CPU scheduling and finally Multi-Level Feedback Queue. We also learn how to use learned how to create a Makefile to make it easier to compile our source files.  We learned that abstraction in the context of CPU virtualization creates the illusion that multiple processes are running simultaneously on separate CPUs. The operating system achieves this through time sharing, where each process is allocated a set amount of time on the CPU before being switched out to allow another process to run. This method ensures efficient multitasking and maximizes CPU utilization by rapidly cycling through processes. Process API stands for Application Programming Interface, which provides functions that allow user programs to interact with the operating system through system calls. A system call is a function provided by the OS that triggers a switch from user mode to kernel mode, granting the process higher...