tailieunhanh - Lecture Operating systems: Lesson 13 - Dr. Syed Mansoor Sarwar
Lecture Operating systems: Lesson 13 - Dr. Syed Mansoor Sarwar. The main topics covered in this lesson include: single- and multi-threaded process, thread models, user and kernel threads, pthreads library with examples, thread management done by user-level threads libraries, . | Operating Systems Lecture 13 Agenda for Today Review of previous lecture Single- and multi-threaded process Thread models User and kernel threads Pthreads library with examples Recap of lecture 28 April 2022 Copyright Virtual University of Pakistan Review of Lecture 12 Process management commands fg bg jobs Z C kill Issues with processes Thread concept Similarities and differences between processes and threads Pros and cons of threads 28 April 2022 Copyright Virtual University of Pakistan Single-Threaded main Process Thread f1 f1 f2 f2 f1 f2 Process 2022 28 April Terminated Copyright Virtual University of Pakistan Multi-Threaded Process main Process Address Space thread t1 f1 main t1 t2 thread t2 f2 PC PC PC f1 f2 28 April 2022 Copyright Virtual University of Pakistan User Threads Thread management done by user- level threads libraries Kernel not aware of threads CPU not interrupted during thread switching A system call by a thread blocks the whole process Fair scheduling P1 has one thread and P2 has 100 threads 28 April 2022 Copyright Virtual University of Pakistan User Threads Examples POSIX Pthreads Mach C-threads Solaris 2 threads 28 April 2022 Copyright Virtual University of Pakistan Kernel Threads Thread management done by kernel Kernel aware of threads CPU switched during context switching A system call does not block the whole process Fair scheduling P1 has one thread and P2 has 100 28 April 2022 Copyright Virtual University of Pakistan Kernel Threads Examples Windows NT 2000 Solaris 2 Linux 28 April 2022 Copyright Virtual University of Pakistan Multithreading Models Support for both user and kernel threads Many-to-One Many user threads per kernel thread process blocks when a thread makes a system call Solaris Green threads Pthreads 28 April 2022 Copyright Virtual University of Pakistan Many-to-One Model User level Threads Kernel level Thread 28 April 2022 Copyright Virtual University of Pakistan Multithreading Models One-to-One One user thread per kernel
đang nạp các trang xem trước