wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Threads

profile
AARON Dsouza
Jul 04, 2024
0 Likes
0 Discussions
51 Reads

A thread is the smallest unit of the code execution in a process

A program may have multiple processes and a process may have multiple threads execution processes occur in the cpu. A thread is a basic utilization of cpu

A thread consists of

• Thread id

• A program counter

• Register set

• Stack

It also shares code section, data section and other operating system resource with the same process, a process is heavy weight if it performs a single thread but multiple threads will allow multiple task execution

Benefits of multithreading

• Responsiveness: eg in a Gui one thread handles frontend Ui and another handles backend process

• Improved performance: significant boost in application as multiple threads run parallelly decreasing the time

• Resource sharing: threads of the same process also share code section, data section and other operating system resource with the same process, making the communication between them easy

• Scalability: multithreads handle increasing workloads significantly by dividing tasks among each other

Multi-threading

Types of threads

• User thread: used by developers and are supported above the kernel and managed without kernel support

• Kernel thread: supported and managed directly by operating system

For a system to exits there should be relationship between user and kernel threads

Types of relationships:

1. One to one

2. Many to one

3. Many to many

One to one: 1 user thread maps to 1 kernel thread, provides more concurrency than many to 1 as it allows a new thread to run when a thread makes blocking call, allows multiple threads to run inn parallel on multiprocessors. But creating a user thread forces to create a kernel thread and overhead of creating kernel thread can cause burden in the application

Many to one: many user threads access 1 kernel thread and the thread management is done by thread library in user space and makes it efficient. But if one of the many user threads makes a blocking system call then the kernel thread will be blocked and entire process will be blocked. Because one thread accesses 1 kernel at a time multiple threads don’t run in parallel on multiprocessors because 1 kernel only runs 1 process.

Many to many: Many user threads are mapped to many kernel threads and number of kernel threads may be specific to an application or machine, developers can create multiple user threads and they run in parallel in a multiprocessor and when a user thread asks for a blocking system call the kernel can execute another thread for execution

DONE BY AARON DSOUZA

53003230005

 

 

 

 

 

 

 

 

 


Comments ()


Sign in

Read Next

Improving the Accuracy of GPS and GNSS

Blog banner

MOVEMBER

Blog banner

Digital Forensics Challenges and Tools

Blog banner

bulk email software

Blog banner

OPERATING SYSTEM OBJECTIVES AND FAULT TOLERENCE.

Blog banner

Understanding the 'Ambiverts'

Blog banner

I/O Buffering

Blog banner

THE DESIRE OF MANY

Blog banner

Operating Systems

Blog banner

What are Tenders its various types

Blog banner

BITCOIN WALLET

Blog banner

Traditional Unix System

Blog banner

The art of being alone

Blog banner

Decrypting Cryptocurrency: Tracing Transactions in Cyber Investigations

Blog banner

objectives and function of operating system

Blog banner

ASANA- A Management System.

Blog banner

Atlantis - The Lost Island.........

Blog banner

Spotify

Blog banner

Meshoo

Blog banner

Juveniles, Internet and Computer Crime

Blog banner

10 Reasons Why Guy BestFriends are the Must in Every Girl's Life

Blog banner

Importance Of Time

Blog banner

Deadlock and Starvation

Blog banner

Modern Operating System

Blog banner

STUDY OF SYSTEM HACKING TOOLS

Blog banner

Os Virtual Memory

Blog banner

Access management

Blog banner

Deadlock and Starvation

Blog banner

Pooja Silver

Blog banner

Computer security techniques

Blog banner

Volatile Memory & Non-Volatile Memory Explained

Blog banner

Senseless Teeths

Blog banner

The Khan mehtab transforming the modular switches

Blog banner

Cyber-crime Investigation and Future Directions

Blog banner

ADD A SPICE TO YOUR LIFE.

Blog banner

Building a Simple Doctor Appointment System in Common Lisp

Blog banner

Women Empowerment

Blog banner

Simple AI Symptom Diagnosis Using LISP – Rule-Based Expert System

Blog banner

Buffer overflow

Blog banner

Data Visualization- Importance and tools (Tableau,Power BI, Matplotlib)

Blog banner

CONCURRENCY: MUTUAL EXCLUSION AND SYNCHRONIZATION-het karia

Blog banner

Uniprocessor Scheduling

Blog banner