1 / 14

Understanding Processes, Threads, and Synchronization

Learn the fundamentals of processes, threads, scheduling, synchronization, memory management, and virtual memory in operating systems, including key concepts and algorithms.

mlaster
Download Presentation

Understanding Processes, Threads, and Synchronization

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Section 10: Last section! Final review

  2. Processes • What is a process? What does it virtualize? • differences between process, thread? • what is contained in process? • what does PCB contain? • state queues? • which states, what transitions are possible? • when do transitions happen? • Process manipulation • what does fork() do? how about exec()?

  3. Threads • What is a thread? • why are they useful? • user-level vs. kernel-level threads? • performance implications • functionality implications • How does thread scheduling differ from process scheduling? • what operations do threads support? • what happens on a thread context switch? what is saved in TCB? • preemptive vs. non-preemptive scheduling?

  4. Scheduling • Long term vs. short term • When does scheduling happen? • job changes state, interrupts, exceptions, job creation • Scheduling goals? • maximize CPU utilization • maximize job throughput • minimize {turnaround time | waiting time | response time} • batch vs. interactive: what are their goals? • What is starvation? what causes it? • FCFS/FIFO, SPT, SRPT, priority, RR, …

  5. Synchronization • Why do we need it? • data coordination? execution coordination? • what are race conditions? when do they occur? • when are resources shared? (variables, heap objects, …) • What is mutual exclusion? • what is a critical section? • what are the requirements of critical sections? • mutex, progress, bounded waiting, performance • what are mechanisms for programming critical sections? • locks, semaphores, monitors, condition variables

  6. Semaphores and Monitors • Semaphores and Condition Variables • basic operations: wait vs. signal? • difference between semaphore and CV? • when and how do threads block on semaphores? CVs? when do they wake? • bounded buffers problem • producer/consumer • readers/writers problem • how is all of this implemented • Moving descriptors on and off queues • Monitors • the operations and their implementation

  7. Memory Management • Mechanisms for implementing memory management • physical vs. virtual addressing • base/limit registers • partitioning, paging, segmentation • Internal and external fragmentation

  8. Review: virtual memory What is paging? What is segmentation? How are both used? How does copy-on-write work? What is it used for? What is the Optimal Page Replacement Algorithm? What is Belady's anomaly? Is LRU Page Replacement the most practical algorithm? Why Not? 8

  9. Review: virtual memory Linux uses both paging and segmentation Paging allows independent address spaces for each process. Segmentation sets up “kernel memory” and “user memory” segments – limited use in linux. How does copy-on-write work? What is it used for? Writeable page mapped into multiple address spaces as one copy until first write. Useful for fork – why? What is The OPT algorithm? Optimal page replacement – evict page the won’t be needed longest into the future What is Belady's anomaly? Bad property of FIFO – fault rate can increase with more allocated frames LRU has great performance but is inefficient in practice. 9

  10. Consider a modern desktop computer on which the hard disk is spinning. What is the most significant delay in reading from a 4K byte file that has not been accessed in a long time? Review: 10

  11. Consider a modern desktop computer on which the hard disk is spinning. What is the most significant delay in reading from a 4K byte file that has not been accessed in a long time? latency awaiting disk rotation and arm movement Review: Disks 11

  12. Windows File System • File Allocation Table • What is contained in the FAT? • What is contained in an entry in the FAT? • Dirents • 8.3 and long file names

  13. Unix File System Source: wikipedia

  14. JFS • What issues was JFS addressing? • What improvements were made?

More Related