Operating System
Operating System
OS
Program (Idle)
Set of
Instruction
Process
(executing)
Control
Information
+
Program
Types of Threads:
• Threads are implemented in following two ways
• User Level Threads -- User managed threads
• Kernel Level Threads -- Operating System managed threads acting on kernel, an operating
system core.
System programmer's view of processes (Cont…)
User Level Threads:
• In this case,
• application manages thread management
• kernel is not aware of the existence of threads.
• The thread library contains code
• for creating and destroying threads,
• for passing message and data between threads,
• for scheduling thread execution and
• for saving and restoring thread contexts.
• The application begins with a single thread and begins running in that
thread.
System programmer's view of processes (Cont…)
User Level Threads:
• Advantages
– Thread switching does not require Kernel mode privileges.
– User level thread can run on any operating system.
– Scheduling can be application specific in the user level thread.
– User level threads are fast to create and manage.
• Disadvantages
– In a typical operating system, most system calls are blocking.
– Multithreaded application cannot take advantage of multiprocessing.
System programmer's view of processes (Cont…)
Kernel Level Threads: