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

Short note on Microsoft office

Blog banner

ITIL Version 3 and 4 differenciation?

Blog banner

38_Exploring The Honeynet Project

Blog banner

Deadlocks

Blog banner

Disk scheduling

Blog banner

Business Intelligence v/s Big Data

Blog banner

What is Data, Information and Knowledge?

Blog banner

Introduction to Virtual Memory - 080

Blog banner

Memory Management

Blog banner

Education?

Blog banner

Virtual Machine

Blog banner

Pilgrimage at LOC: A privilege and a paradox

Blog banner

Evolution of Operating Systems

Blog banner

A Statistical Analysis of Player Performance and their Value in cricket

Blog banner

E-Cash (Electronic Cash)

Blog banner

Mobile Security

Blog banner

DBMS and various career options related to it.

Blog banner

Kernel Modes: User Mode vs. Kernel Mode - 80

Blog banner

Constrains in service design

Blog banner

The Evolution of Operating Systems

Blog banner

Internet of Things and cyber security

Blog banner

The Role of cryptography in cyber security

Blog banner

SWEET SHREDDED MANGO CHUNDA (MANGO CHUNDA)

Blog banner

CYBERPEACEKEEPING: NEW WAYS TO PREVENT AND MANAGE CYBERATTACKS

Blog banner

Autonomy Vehicles: Future Ki Gadiya

Blog banner

To travel is to live

Blog banner

Threats To Computer System

Blog banner

Fun Christmas Activities For Toddlers & Kids

Blog banner

Processing Crime and Incident Scenes

Blog banner

Virtual memory

Blog banner

City of Mumbai (Bombay):

Blog banner

PPT methodology

Blog banner

Starting Android Activity Using Intent

Blog banner

Online Games

Blog banner

Virtual Memory

Blog banner

Health and fitness in technology

Blog banner

The Impact of Tolerances and Wall Thickness on Pipeline Integrity

Blog banner

5 People who claimed to have Time Traveled

Blog banner

Product Discount Calculator

Blog banner

OS Assignment 1

Blog banner

Dal Bafla Recipe

Blog banner

Data Security and Data Privacy in Data Science

Blog banner