Posts

CST334 - Week 4

Week 4 Reflection Paging - Virtual address --> Physical address Find the VPN bits (first X bits of a virtual address). Find the offset bits of the virtual address, which are the last Y bits (or, the virtual address with leading VPN bits removed). Find the corresponding PTE (if available). If the most significant bit (MSB) is a 1, it is a valid address. If 0, it is not valid and a physical address cannot be obtained from this virtual address. Find the PFN, which is the last Y bits of the PTE. If one is not listed, the number of pages a physical address can hold determines the PFN bits using the formula: [log2(number of pages)]. Then, combine the PFN and offset in this order to obtain the translated physical address. Swapping Swapping makes use of a few policies to determine what pages to swap in memory: The optimal policy (aka Belady or MIN) replaces pages that are accessed furthest in the future to maximize cache hit rates. This is not very practical because implementing pr...

CST334 - Week 3

Week 3 Reflection We learned about virtual memory and how to translate it into physical memory.        The two memory types that we use in our programs is stack memory and heap memory. The stack is managed mostly by the compiler while the heap is long-lived and only allocated/deallocated by the programmer. The heap is allocated near the base of the address space (0) and grows outward, while the stack is allocated at the end of the address space (size_of) and grows downward towards the heap/program code.We used two methods of memory address translation - base and bounds (aka dynamic relocation), and paging.        Base and bounds uses two registers: the base register and the bound (aka limit) register. With these two registers, a program can be translated to physical memory using its virtual address + this base register. However, the free memory between the stack and heap is wasteful and prevents other larger address spaces to fit in desp...

CST334 - Week 2

Weekly Reflection, Week 2 I feel a lot more confident in my understanding of C now! From what we've covered in class: CPU scheduling is important to optimizing processing times. Scheduling makes use of two metrics: turnaround time and response time. Turnaround time is how long it takes for a process to complete from when it first entered the schedule. Response time is how long it takes for a process to begin its first run from when it first entered the schedule. The main schedule patterns we've seen are First In, First Out (FIFO and its related schedule Last in First Out or LIFO), Shortest Job First (SJF), Shortest Time-to-Completion First (STCF), and Round Robin (RR). FIFO chooses the first process entered and completes it, then to the second-most process entered, etc. LIFO chooses the last entered process (the tail end) and completes it, then to the second-last process entered, etc. SJF prioritizes jobs with the shortest duration and completes them first.  STCF prioritizes jo...

CST334 - Week 1

This Week's Reflection      In this class, we discussed about the basics of operating systems - how they work, why they exist, and what they do differently depending on the task at hand. We discuss memory, hardware and software integrations, user mode vs. kernel mode, and what an operating system abstracts to the user.      The main operation that the OS handles is abstracting multiple processes at once to do work for the user. The OS performs this by virtualizing the CPU via time sharing. The rules that govern how the OS handles time sharing are called policies.      I had trouble remembering what the * and & operators do in C. I get confused where they are used and what differentiates them from each other, like a struct* var, a struct var, and struct *var. Using * before a variable (like *var) is a dereference. When initializing a pointer, use struct *var. This creates a variable of type struct *. The & operator refers to an address...

CST363 Week 8

(Mobile format, bear with me!) The three most important things that I've learned in this course are: - Understanding how ER diagrams work, how to create one from a client's story, and how to translate them into a database of choice. How to use a DBMS is good, but the fundamentals of translating a story into an ER diagram can apply to many more situations. - Knowing different types of DBMS and their uses. Traditional (transactional) databases like MySQL are good for managing in-house data for a moderately small business or similar. NoSQL databases that manage big data like MongoDB are useful for managing high volumes of it in a timely manner. Database design is dependent on what DBMS is used. - Gaining experience with MySQL. MySQL is a traditional database that uses the SQL language to create queries. While simple to begin with, it can become much more complex with nested queries. I would want to practice more with nested queries because it is still confusing for me.

CST363 Week 7

Learning Journal Week 7      MongoDB and MySQL are two types of database - MongoDB is a document database that utilizes NoSQL practices, while MySQL is a relational database that uses tables. They are similar in that they can both store large amounts of data and retrieve them reliably, if created correctly. Their main difference is what kind of data is stored in them - MySQL databases are better at handling transactional data, while MongoDB databases can manage big data more efficiently than traditional SQL databases like MySQL.       If I were to use a database for a project, I would most likely use MySQL for it. I do not believe I need any data properties that are exclusive to big data, so having more control over the database's environment using MySQL would be ideal.       If I were to create a different project for some sort of social network, I would use MongoDB over MySQL. Social network data tends to have big data properties,...

CST363 Week 6

Week 6 Learning Journal      This week, I learned a lot more about how JDBC works and how to connect a java program to a MYSQL database. This week's group project was easy to understand, and while I had some difficulty with a few implementations, my teammates were able to figure out what went wrong and explained to me what to do instead. Thanks team!