Posts

Showing posts from July, 2025

Week 5 - CST 334

 This week we completed the midterm exam. I definitely feel like I needed to study more for it. Besides the midterm, we learned about concurrency and how it allows multiple parts of a program to run at the same time using threads. Threads are different from processes in that they share memory space, making them more difficult to manage. We also learned how to create and manage threads using pthreads. We also learned about locks and how they are used to prevent threads from interfering with each other. Specifically, mutexes, or mutual exclusions, are used so that only one thread can access code or data at a time. When a thread accesses data, it locks the mutex. Another thread may only access that same piece of data until it is unlocked by the first thread. 

Week 4 - CST 334

 This week we learned about paging, which is how the OS manages memory. Paging is when memory is broken down into pages of a certain size to avoid problems like fragmentation. We also learned about page tables, which is how pages are kept track of and holds all address translations. Sometimes, it is quicker to translate addresses by using the translation-lookaside buffer, which is a cache of popular translations, that access the page table. Sometimes page tables can become too large and use too much memory. Solutions to this include using a hybrid system of paging and segmentation or multilevel page tables Finally, we learned about the policies an OS uses to evict pages from memory when it becomes full. A few of them include Optimal Replacement, FIFO and LRU. FIFO will remove the pages from the cache in order of oldest to most recent. Optimal Replacement would replace the page that will be used the furthest in the future. LRU will evict the page that hasn't been access for the long...

Week 3 - CST 334

 This week we learned about address spaces and how virtual address spaces create this illusion of partitioned memory spaced even though it is all shared on physical memory. We also learned how to allocate and free up memory space using malloc() and free(). After allocated memory, malloc() returns a pointer to it. Using base and bounds, we perform address translation. The base and bounds are values of where the process is located. This helps protect data from being access by preventing processes to accessed locations that are not in its bounds. We also learned about segmentation which is where memory is slip into segments like code, heap and stack. The beginning two bits of a virtual memory address shows where the process is located. A location in the code begins with 00, a location in the heap begins with 01 and a location in the stack begins with 11. By segmenting memory, we are able to grant certain permissions based on what the segment does. Finally, we learned about free-space ...

Week 2 - CST 334

 This week we learned about the concept of process which is a running instance of a program. A process consists of several components: address space, registers, and I/O state. The OS is responsible for managing processes using process API. The OS can allow many processes to run concurrently using CPU virtualization. The key system calls like fork(), exec(), and wait() are used to create new processes, wait for a child process to complete and execute the next process.  We also learned about limited direct execution which is when user programs run directly on the CPU for speed. It is limited because the hardware and OS work together to retain control and enforce safety. By switching between from one process to another, the OS performs context switching, which saves the current process context and loads the next one's.  Another important concept we learned about was CPU scheduling, where processes are ran depending on factors like time of arrival or duration until completion...

First Week - CST 334

 During the first week of CST 334, we learned how to convert binary to hexadecimal and vice versa. This looked confusing at first but is actually very straight forward. We also learned about computer architecture and the main components of a computers: the processor, storage and I/O devices. With storage, as the access time gets faster, the capacity of the storage unit becomes smaller.  One key concept from the textbook was about virtualization of resources. This creates the illusion that multiple programs are running at the same time by switching between them quickly. However, concurrency can arise during virtualization. This is when multiple threads or processes use shared resources at the same time, which can cause data corruption and loss.