Week 26

CST-334 Week 2

This week was our second week in CST-334, also known as Operating Systems.

Operating Systems: Three Easy Pieces

This week we read chapters 4-8 of our course textbook.

Chapter 4: Processes

This chapter discusses processes, which are running programs, and how the OS virtualizes the CPU to run multiple processes.

Key Takeaways:

  • The OS runs multiple processes by stopping and starting them during context switches.
  • All OSs have APIs that processes use to interact with resources and the OS.
  • To create a process executable code of a program must be loaded from storage onto memory.
  • Processes can be running, ready, or blocked.
  • The OS tracks data for each process. 

Chapter 5: Process API

This chapter discusses certain important aspects in Process APIs.

Key Takeaways:

  • The fork() system call creates a new process. The new process is identical to its parent process when it made the system call.
  • The wait() system call allows a process to wait for another process, or its child processes, to finish before continuing to run.
  • The exec() system call changes one process into another process. 

Chapter 6: Direct Execution

This chapter discusses how processes are ran on the CPU.

Key Takeaways

  • Processes run directly on the CPU. This means that the OS cannot run while a process is running.
  • The user mode, which processes typically run on, places certain restrictions on what a process can do.
  • The kernel mode, which the OS runs in, has no restrictions on what a process can do.
  • System calls allow processes to make restricted operations in a controlled, safe way.
  •  Processes are able to voluntarily give control back to the OS, such as when making system calls.
  • The OS is able to directly take control of the CPU through interrupts, such as the timer interrupt. 

Chapter 7: CPU Scheduling

This chapter discusses CPU and process scheduling.

Key Takeaways:

  • Turnaround time measures how quickly a job completed by comparing its arrival and completion time.
  • Response time measures how quickly a job began work by comparing its arrival time and the time it first began running.
  • First In, First Out (FIFO) completes jobs in order of when they arrived.
  • Shortest Job First (SJF) completes jobs based on their total duration.
  • Shortest Time-to-Completion First (STCF) completes jobs based on their time remaining.
  • Round Robin (RR) Switches between each process regularly to improve response time.
  • When a process makes a call for I/O it is blocked until the I/O request is completed, allowing other processes to run. 

Chapter 8: Multi-Level Feedback

This chapter discusses Multi-level Feedback Queues (MLFQ).

Key Takeaways:

  • MLFQs sort jobs by priority.
  • Jobs with higher priority are run before those with lower priority.
  • Jobs with the same priority are run with the Round Robin schedule.
  • When a job arrives it is placed at the highest priority.
  • When a job runs for an allotted amount of time it drops in priority.
  • Priority boosts occasionally boost all jobs to the highest priority, ensuring that no job starves, and that jobs that change behavior are able to change priority.
   

Comments

Popular posts from this blog

Week 4

Week 2

Week 1