1 / 20

User-level Multithreading

Process. Process. Process. Scheduler. Scheduler. Scheduler. processor. processor. processor. User-level Multithreading. Two independent schedulers:. User Space. OS Kernel. Process. Process. Process. Scheduler. processor. processor. processor. Kernel-level Multithreading.

makya
Download Presentation

User-level Multithreading

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. Process Process Process Scheduler Scheduler Scheduler processor processor processor User-level Multithreading • Two independent schedulers: User Space OS Kernel

  2. Process Process Process Scheduler processor processor processor Kernel-level Multithreading • One single scheduler: User Space OS Kernel

  3. Process Process Process Scheduler Scheduler Scheduler processor processor processor Hybrid Multithreading • Two “cooperating” schedulers User Space OS Kernel • Blocking syscalls are still a problem!

  4. Scheduler Activations • First proposed by [Anderson et al. 91] • Idea: cooperation between schedulers should take place in both directions • User scheduler uses system calls • Kernel scheduler should use upcalls! • Upcalls • Notify the user-level of kernel scheduling events • Activations • A new structure to support upcalls (~kernel thread) • As many running activations as processors • Kernel controls activation creation and destruction

  5. CPUtimewasted syscall I/O request interrupt • …rather use the following scheme: CPU used User Space upcall upcall Kernel Space Hardware Scheduler Activations • Instead of User Space Kernel Space Hardware

  6. Working principle • Blocking syscall scenario on 2 processors Process User scheduler

  7. new Working principle • Blocking syscall scenario on 2 processors Process

  8. new Working principle • Blocking syscall scenario on 2 processors Process

  9. Blocking syscall Working principle • Blocking syscall scenario on 2 processors Process

  10. New + blocked Working principle • Blocking syscall scenario on 2 processors Process

  11. I/O completion Working principle • Blocking syscall scenario on 2 processors Process

  12. Unblocked Working principle • Blocking syscall scenario on 2 processors Process

  13. Working principle • Blocking syscall scenario on 2 processors Process

  14. On the cost of preemption • When the kernel preempts an activation • It must inform the user-level scheduler • Why? • a user thread may own a spin-lock! • How? By triggering a preempt upcall • Problems • A preemption may occur at any time • asynchronous context switches • many code sections must be protected e.g. the marcel_yield() function...

  15. blocking syscall registers sp sp On the cost of unblock events thread activation

  16. thread sp Clock int. registers registers blocked sp sp sp sp activation On the cost of unblock events thread activation

  17. thread sp registers registers registers registers sp sp sp activation On the cost of unblock events thread activation

  18. thread sp registers registers registers sp sp activation On the cost of unblock events thread

  19. thread sp jb sp registers registers sys_restart activation On the cost of unblock events thread

  20. thread sp registers activation On the cost of unblock events thread

More Related