Abstract


When thread becoming blocked locally

  • Thread calls Runtime System
    1. checks to see if the thread must be put into blocked state.
    2. If so, it stores the thread’s registers (i.e., its own) in the thread table, looks in the table for a ready thread to run

Benefits


Good Compatibility

  • Thread can be implemented on an OS that does not support threads.

Great Performance

Great Customisation

  • Allow each Process (进程) to have its own customized Process Scheduling Algorithms

Better Scalability

Cons


Declined Performance

Risk of Thread Hogging

Programmers generally want threads in applications where the threads block often

Examples


PThread (C)

pthread_yield()

  • The Library Call for thread to give CPU to other threads
  • In Process (进程), we don’t have this. Because Thread is in the same program, written by the same programmer, so they collaborate to get fulfil a particular feature

Others

Golang Goroutines

Terminologies


Runtime System

Scheduler Activations

  • Instead of relying on the Kernel for every thread management decision, the Runtime System is responsible for scheduling Thread
  • Mitigates inefficiency from Kernel