User threads kernel threads user threads are

This preview shows page 6 - 10 out of 24 pages.

User threads – kernel threads: " User threads are supported above the kernel and are managed without kernel support. " Kernel threads are supported and managed directly by the operating system. " All contemporary operating systems support kernel threads. " There must exist a relationship between user threads and kernel threads. Threads 12 Multithreading Models (cont’d) ! Many-to-One model : " Map many user-level threads to one kernel thread. " Thread management is done by the thread library in user space . # The library provides the supports of thread creation, scheduling … " Is efficient , because there is no kernel intervention. " But, as the kernel is not aware of user threads, # The entire process will block if a thread makes a blocking system call. " Multiple threads are unable to run in parallel on multiprocessors. Threads
Image of page 6

Subscribe to view the full document.

Threads 7 13 Multithreading Models (cont’d) Many-to-One model Threads 14 Multithreading Models (cont’d) ! One-to-One model : " Map each user thread to a kernel thread. " Allow another thread to run when a thread makes a blocking system call. " Allow multiple threads to run in parallel on multiprocessors. " But … creating a user thread requires creating the corresponding kernel thread. # The creation overhead can burden the performance of an application. # Most implementations of this model restrict the number of threads supported by the system. " Supported by major contemporary Operating Systems including Solaris 10, Linux, and Windows family. Threads
Image of page 7
Threads 8 15 Multithreading Models (cont’d) One-to-One model Threads 16 Multithreading Models (cont’d) ! Many-to-Many model : " Multiplex many user-level threads to a smaller or equal number of kernel threads. " The number of kernel threads may be specific to either a particular application or a particular machine. " The many-to-many model does not suffer from the shortcomings of the previous two models. # Many-to-One: the kernel can schedule only one thread at a time (on a multiprocessor system) . # One-to-One: the number of threads is limited. # Many-to-many model $ allows as many user threads as necessary $ the corresponding kernel threads can run in parallel on a multiprocessor. When a thread is blocked, $ the kernel can schedule another thread for execution. Threads
Image of page 8

Subscribe to view the full document.

Threads 9 17 Multithreading Models (cont’d) Many-to-Many model Threads 18 Thread Libraries ! A thread library provides the programmer an API for creating and managing threads. ! Two ways of implementing a thread library: " To provide a library entirely in user space with no kernel support. # All code and data structures for the library exist in user space. # All function calls result in local function calls in user space; and no system calls. " To implement a kernel-level library: # Supported by the operating system. # Code and data structures for the library exist in kernel space.
Image of page 9
Image of page 10
You've reached the end of this preview.
  • Spring '12
  • GwangS.Jung
  • System Call, Native POSIX Thread Library, thread libraries

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern