wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

THREADS (assignment 1)

profile
Aastha Saraf
Jul 05, 2024
0 Likes
0 Discussions
50 Reads

In operating systems, threads are the basic units of execution that consist simultaneous processing and act as a part of an individual process. Threads unlike traditional processes are independent execution units, each with their own memory space but they share the same address and hence find it easy to communicate between threads and also synchronize. Process vs Thread in Operating SystemsExplination

Meaning: A thread is a light weight process that exists inside of the main process. This thread shares memory, file descriptors, process context with other threads that belongs to the same Process. Normally Threads are less expensive to create and maintain than Processes.

Types of Threads:

1.⁠ ⁠User-Level Threads: This is done at application (or user) level without kernel support - essentially the threads are managed by an application itself, not always suitable as when information needs to be seconded back and forth between a calling thread from different process than receiver one or switchable on irregular bases for example in some I/O cases). Process is treated by the operating system as a single entity.
2.⁠ ⁠Kernel-Level Threads: Explicitly created, supported and managed by the operating system (as opposed to implicit/ application version) OS-managed entities are called KLT. The kernel sees each thread separately, so the threads can be scheduled across multiple cores...

Advantages:

1.⁠ ⁠Responsivity - Threads can be used to keep an application responsive when performing long-running tasks in a background.

2.⁠ ⁠Resource Sharing: Since threads within same process share data and resources like memory with other thread, it is much easier to implement resource sharing between a set of coordinated threads than executing in separate processes.

3.⁠ ⁠Efficiency: Creating and managing threads is cheaper than creating - and context switching between processes.

States of Threads:

The threads in an operating system have multiple states.

1.⁠ ⁠Running: The process is running now on the CPU.

2.⁠ ⁠In the Ready stage, your task is all set to execute whenever it gets a sufficiently large time slice from processor at CPU levels.

3.⁠ ⁠Blocked: Resources are unavailable (typically I/O operation).

Thread Models:

 Different operating systems may implement threads differently:

1.⁠ ⁠Many-to-One Model: Many user-level threads mapped to a single kernel thread.

2.⁠ ⁠One-to-One Model: Each user-level thread corresponds to one kernel thread.

3.⁠ ⁠Many-to-Many Model: Multiple user-level threads mapped to multiple kernel threads, providing a balance between flexibility and efficiency.

Lastly threads are necessary for parallelism and concurrency concepts within a process making use of modern multi-core processors effectively. Knowledge about their management, synchronization and communication techniques is essential for developing efficient programs in an operating system environment. Threads are fundamental; they form the basis of modern operating systems, and are used extensively in server side programming and graphical user interfaces. They are essential for developing efficient, responsive and scalable software systems as they give a powerful mechanism to exploit the parallelism within multi-core processors.


Comments ()


Sign in

Read Next

File management

Blog banner

Virtual Memory

Blog banner

Instagram Features in 2023 That Will Leave You Stunned!

Blog banner

Uniprocessor Scheduling

Blog banner

Digital Marketing - The new way to reach end consumer

Blog banner

S-Tool : Steganography

Blog banner

ADD A SPICE TO YOUR LIFE.

Blog banner

(Input/Output) in os

Blog banner

Tiranga - Abbas Haveliwala

Blog banner

CSI and Organizational Change

Blog banner

Memory management

Blog banner

Animal’s have my heart

Blog banner

TRAIN TRAVELING

Blog banner

Disk cache

Blog banner

Importance of business process documentation

Blog banner

Tea, Coffee, Red Wine, and Teeth: A Stain Survival Guide

Blog banner

Swiggi

Blog banner

Apple

Blog banner

How to grow followers on Instagram business account?

Blog banner

GraphQL

Blog banner

OPERATING SYSTEM OBJECTIVES AND FAULT TOLERENCE.

Blog banner

SESSION HIJACKING

Blog banner

Cache Memory

Blog banner

Principles of Service Operation

Blog banner

Therapy Myths That Need to End in 2025

Blog banner

Disk scheduling

Blog banner

My favourite food

Blog banner

Cyber Security in Quantum and Space Communication

Blog banner

GIS Applications: How Different Industries are Leveraging Geospatial Data

Blog banner

Music

Blog banner

Bitcoin sent using radio waves! No internet!

Blog banner

MUTUAL EXCLUSION

Blog banner

Direct memory access

Blog banner

Why home remedies don’t work for Hangover?

Blog banner

ART AND CULTURE OF VRINDAVAN

Blog banner

COMMUNICATION

Blog banner

Data-Driven Prediction of Virtual Item Prices in Online Games

Blog banner

Different memory allocation strategies

Blog banner

IT security management

Blog banner

New Ransomware Encrypts Your Android And Then Changes PIN Lock

Blog banner

EFT

Blog banner

Article on different management system

Blog banner