In this scheme the kernel must inform an application

This preview shows page 21 - 24 out of 24 pages.

" In this scheme, the kernel must inform an application about certain events. # For example, a user thread is about to block. # This procedure is known as an upcall . " Upcalls are handled by the thread library with an upcall handler . # The kernel first allocates a new virtual processor to the handler. # The handler saves the state of the blocking thread and relinquishes the virtual processor on which the blocking thread is running. # The handler then schedules another user thread that is eligible to run on the new processor. Threads
Image of page 21

Subscribe to view the full document.

Threads 22 Operating System Examples ! Windows XP Threads ! Linux Thread Windows XP Threads
Image of page 22
Threads 23 Windows XP Threads ! Implements the one-to-one mapping, kernel-level ! Each thread contains " A thread id " Register set " Separate user and kernel stacks " Private data storage area ! The register set, stacks, and private storage area are known as the context of the threads ! The primary data structures of a thread include: " ETHREAD (executive thread block) " KTHREAD (kernel thread block) " TEB (thread environment block) Linux Threads
Image of page 23

Subscribe to view the full document.

Threads 24 Linux Threads (cont’d) ! Thread creation is done through clone() system call ! clone() allows a child task to share the address space of the parent task (process) ! Linux refers to them as tasks rather than threads " In NPTL (Native POSIX Thread Library), all threads belong to a single process. NPTL threads are based on KSEs(kernel scheduling entities). A non-threaded process is also a KSE. A threaded process has more than one KSEs. All KSEs are scheduled by the kernel. " NPTL is still based on clone() system call, but fully POSIX compliant with fast mutual exclusion (futex) mechanism. " See the papers on cmp426 website about NPTL and the following site nptl.bullopensource.org/index-old.html
Image of page 24
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