Posts

Showing posts from July, 2025

CST 334 - Week 5

This week, I learned about multi-thread code. Threads are helpful because they exist under a process and share the same virtual address. This way it does not have to start up another process and allows for concurrency. Concurrency offers benefits such as an IDE handling edits while background compilation is occurring. With this comes some risks of poor execution that could lead to problems. The critical section is where both threads run a code, meaning that piece of code accesses a shared resource. It is important to understand that two threads should not run at the same time in this section. Mutual exclusion is a condition that can help with this, by ensuring that at most, only one thread will be within a critical section at a time.   The race condition is when the output of a multi-threaded program depends on the relative speed or scheduling of the thread. It is something that should be avoided because it means there is a lack of consistency on the output of the program. Ens...

CST 334 - Week 4

This week, I learned about how translation-lookaside buffer (TLB) is used in address translation. TLB is a hardware cache implemented as an associative cache  maintained to speed the process of look-ups. Despite it having the ability to be rather useful, it is only as good as the data it contains. If an VPN of the virtual address being searched for is not within the TLB contents, then it will miss the search until that data is stored. It the data is not within the cache, then it will be retrieved from the page table instead. That data that is selected to be cached are determined by how often they are accessed. I also learned how to calculate the number of bits required for the  VPN and how many bits are the offset. I also learned about the process of swapping, where the most important pages are selected to be stored in the physical memory. This is how to address the issue of running out of memory space. To help this process, a present bit is utilized in the page table to repre...

CST 334 - Week 3

This week, I learned about the various factors of free space management. This includes the way operating systems virtualizes memory through the use of virtual addresses. This is when a process tries to load into an address, the OS works with the support of hardware will ensure that it goes into a different virtual address. This gives the illusion that there is a large, private address space for each running program. This tactic is transparent to the programs where only the OS knows where in the physical memory the instructions and data resides. To help eliminate the waste of free space in the memory, a segmentation tactic is used where a base and bound pair is is generated for each logical segment instead. With this tactic, the code, stack, and heap are now placed in different parts of physical memory independently of one another by the OS.  I spent a significant amount of time practicing and ensuring I identified the patterns in getting the calculations correct when determining th...

CST 334- Week 2

This week, I spent a lot of time learning scheduling algorithms. This includes: FIFO, which runs the jobs in the order they arrive, SJF, which runs the shortest job first and so fourth, STCF, which determines which job has the least amount of time left, every time a new job enters and reschedules the jobs using this information, and Round Robin, which then slices each job into a certain time frame, taking turns to run each slice. Each one has their pros and cons, depending on what is needed. Take for example how Round Robin has the fastest response time but the average turnaround time suffers. FIFO makes sense, but if the job that starts first takes a large amount of time, the remaining jobs will suffer in performance, which can affect the turnaround time. In addition to these concepts, I spent a tremendous amount of time trying to figure out what style works best for me when it comes to make calculations on the average response time and turnaround time. It is easy to get lost in the c...