5 - Thread
5 - Thread
Threads
Vietnamese-German University
Ngoc Tran, Ph.D.
[email protected]
Many-to-One
One-to-One
Many-to-Many
C:\posixthread 10
C:/Winthread 10
th Edition
Operating System Concepts – 910 th Edition 4.26 Silberschatz,
Silberschatz,Galvin andGagne
Galvin, Gagne©2018
©2013
Implicit Threading
th Edition
Operating System Concepts – 910 th Edition 4.40 Lecturer: Ngoc Tran, Ph.D. Silberschatz,
Silberschatz,Galvin andGagne
Galvin, Gagne©2018
©2013
Scheduler Activations
Both M:M and Two-level models require
communication to maintain the appropriate
number of kernel threads allocated to the
application
Typically use an intermediate data structure
between user and kernel threads – lightweight
process (LWP)
Appears to be a virtual processor on which
process can schedule user thread to run
Each LWP attached to kernel thread
How many LWPs to create?
Scheduler activations provide upcalls - a
communication mechanism from the kernel to
the upcall handler in the thread library
This communication allows an application to
maintain the correct number kernel threads