wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Threads

profile
Sarvo Singh
Aug 14, 2024
0 Likes
0 Discussions
168 Reads

Definition

Within a process, a thread is a single sequence stream. Because threads have certain characteristics of processes, they are frequently referred to as lightweight processes. Every thread is associated with a single process. A process may have several threads if the operating system allows multithreading. However, threads are only useful if there are several CPUs; otherwise, two threads must context switch for each CPU.

 

Need for Threads

-Threads run in parallel improving the application performance. Each such thread has its own CPU state and stack, but they share the address space of the process and the environment.

-Threads can share common data so they do not need to use inter-process communication. Like the processes, threads also have states like ready, executing, blocked, etc.

- Similar to a process, a thread can be given priority, with the highest priority thread being scheduled first.

- A Thread Control Block (TCB) is unique to each thread. Similar to the process, the thread experiences a context transition, and the contents of its register are saved in (TCB). Since threads share resources and address space, synchronization is also necessary for the thread's multiple actions.


Components of Threads

  • Stack Space:
  • Register Set
  • Program Counter

Types of Threads

User Level Thread:

It is a type of thread that is not created using system calls. The kernel has no work in the management of user-level threads. User-level threads can be easily implemented by the user. In case when user-level threads are single-handed processes, kernel-level thread manages them. Let’s look at the advantages and disadvantages of User-Level Thread.


Kernel Level Thread:

It is a type of thread that can recognize the Operating system easily. Kernel Level Threads has its own thread table where it keeps track of the system. The operating System Kernel helps in managing threads. Kernel Threads have somehow longer context switching time. Kernel helps in the management of threads.

 

Multithreading

A thread is also known as a lightweight process. The idea is to achieve parallelism by dividing a process into multiple threads. For example, in a browser , multiple tabs can be different threads. MS Word uses multiple threads: one thread to format the text, another thread to process inputs, etc. More advantages of multithreading are discussed below.

Multithreading is a technique used in operating systems to improve the performance and responsiveness of computer systems. Multithreading allows multiple threads (i.e., lightweight processes) to share the same resources of a single process, such as the CPU, memory, and i/o devices.

 


Comments ()


Sign in

Read Next

"The Benefits of Using GIS in Agriculture"

Blog banner

Fault Tolerance

Blog banner

Benefits of Yoga

Blog banner

BLOCKCHAIN MACHANISM

Blog banner

Riddhi Miyani 53003220140

Blog banner

Hacking Mobile Platforms

Blog banner

Street foods

Blog banner

Scala - a programming tool

Blog banner

PPC Advertising and its Impressive Benefits

Blog banner

Uniprocessor Scheduling

Blog banner

The Power of Cyber Forensic in Solving Crimes

Blog banner

Lucidchart

Blog banner

IT RISK

Blog banner

Dental Problems That Start Small But Should Never Be Ignored

Blog banner

CYBERBULLYING: Negative comments!

Blog banner

Advanced Persistent Threats (APTs)

Blog banner

Traditional UNIX Scheduling

Blog banner

Understanding Univariate, Bivariate, and Multivariate Analysis in Data Science

Blog banner

Disk Management

Blog banner

The Role of Data Provenance and Lineage in Modern Data Science

Blog banner

Scheduling in Operating Systems

Blog banner

File Management In OS

Blog banner

Service Operations Principles

Blog banner

Preparing Students for Higher Education: How International Schools Shape Future Success

Blog banner

Steganography and Steganalysis

Blog banner

Efficiency of SQL Injection Method in Preventing E-Mail Hacking

Blog banner

Deadlock and Starvation in an Operating System

Blog banner

Deadlock in Operating System

Blog banner

Top 5 Places To Stay And Visit In Berlin, Germany

Blog banner

Memory management

Blog banner

TAILS OS

Blog banner

From Websites To Super Apps For Digital User Experience

Blog banner

I/O buffer and its techniques

Blog banner

Evolution of Operating System

Blog banner

Thumb Sucking: When It’s Normal and When It Becomes a Dental Problem

Blog banner

What is Anxiety? How to manage Anxiety?

Blog banner

OPERATING SYSTEM

Blog banner

SECURITY TOOLS

Blog banner

Business-to-Business

Blog banner

A-B-C of Networking: Part-3 (Topology [Ring, Tree, Mesh])

Blog banner

Virtual Machine

Blog banner

Different types of e-commerce platforms or advantages and disadvantages

Blog banner