The Wayback Machine - https://web.archive.org/web/20240708074301/https://www.geeksforgeeks.org/thread-models-in-operating-system/
Open In App

Thread Models in Operating System

Last Updated : 10 Feb, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

A thread is a light weight process which is similar to a process where every process can have one or more threads. Each thread contains a Stack and a Thread Control Block. There are four basic thread models : 

1. User Level Single Thread Model : 
 

  • Each process contains a single thread.
  • Single process is itself a single thread.
  • process table contains an entry for every process by maintaining its PCB.

 

2. User Level Multi Thread Model : 
 

  • Each process contains multiple threads.
  • All threads of the process are scheduled by a thread library at user level.
  • Thread switching can be done faster than process switching.
  • Thread switching is independent of operating system which can be done within a process.
  • Blocking one thread makes blocking of entire process.
  • Thread table maintains Thread Control Block of each thread of a process.
  • Thread scheduling happens within a process and not known to Kernel.

 

3. Kernel Level Single Thread Model : 
 

  • Each process contains a single thread.
  • Thread used here is kernel level thread.
  • Process table works as thread table.

 

4. Kernel Level Multi Thread Model : 
 

  • Thread scheduling is done at kernel level.
  • Fine grain scheduling is done on a thread basis.
  • If a thread blocks, another thread can be scheduled without blocking the whole process.
  • Thread scheduling at Kernel process is slower compared to user level thread scheduling.
  • Thread switching involves switch.

 

 



Similar Reads

Difference between User Level thread and Kernel Level thread
Introduction - So in this article, we will see the overview of the User Level thread and Kernel Level thread. and also understand the basic required terms: User-Level Thread- The User-level Threads are implemented by the user-level software. the user-level threads are basically created and implemented by the thread library which OS provides as an A
4 min read
Relationship between User level thread and Kernel level thread
Introduction: User-level threads and kernel-level threads are two different approaches to implementing thread management in an operating system. User-level threads are managed entirely by the application, without any involvement from the operating system kernel. The application manages the creation, scheduling, and synchronization of threads, using
9 min read
Difference Between Thread ID and Thread Handle
Prerequisite: Thread in Operating System Thread Id is a long positive integer that is created when the thread was created. During the entire lifecycle of a thread, the thread ID is unique and remains unchanged. It can be reused when the thread is terminated. The Thread get_id() method can be studied here where we can see how it's used. Thread Handl
3 min read
Thread Control Block in Operating System
Very similar to Process Control Blocks (PCBs) which represents processes, Thread Control Blocks (TCBs) represents threads generated in the system. It contains information about the threads, such as it's ID and states. The components have been defined below: Thread ID: It is a unique identifier assigned by the Operating System to the thread when it
1 min read
Thread in Operating System
A thread is a single sequence stream within a process. Threads are also called lightweight processes as they possess some of the properties of processes. Each thread belongs to exactly one process. In an operating system that supports multithreading, the process can consist of many threads. But threads can be effective only if the CPU is more than
6 min read
Queuing Models in Operating System
In general, there is no fixed set of processes that run on systems; thus, measuring the exact processing requirements of processes is impossible. We can, however, measure the distributions of CPU bursts and I/O bursts over the course of a process and derive a mathematical formula that identifies the probability of a specific CPU burst. The arrival
15 min read
Thread States in Operating Systems
When a thread moves through the system, it is always in one of the five states: (1) Ready (2) Running (3) Waiting (4) Delayed (5) Blocked Excluding CREATION and FINISHED state. When an application is to be processed, then it creates a thread. It is then allocated the required resources(such as a network) and it comes in the READY queue. When the th
2 min read
System Protection in Operating System
Introduction: System protection in an operating system refers to the mechanisms implemented by the operating system to ensure the security and integrity of the system. System protection involves various techniques to prevent unauthorized access, misuse, or modification of the operating system and its resources. There are several ways in which an op
3 min read
User View Vs Hardware View Vs System View of Operating System
User View of Operating System: The Operating System is an interface, hides the details which must be performed and present a virtual machine to the user that makes it easier to use. Operating System provides the following services to the user. Execution of a programAccess to I/O devicesControlled access to filesError detection (Hardware failures, a
1 min read
File System Implementation in Operating System
Prerequisite - File Systems in Operating Systems A file is a collection of related information. The file system resides on secondary storage and provides efficient and convenient access to the disk by allowing data to be stored, located, and retrieved. File system implementation in an operating system refers to how the file system manages the stora
11 min read
Article Tags :