wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Threading

profile
Sanket Deora
Jul 15, 2023
0 Likes
0 Discussions
148 Reads

Thread is a single sequence stream within a process. Threads have same properties as of the process so they are called as light weight processes. Threads are executed one after another but gives the illusion as if they are executing in parallel. Each thread has different states. 

Similarity between Threads and Processes –  

 

Only one thread or process is active at a time 

Within process both execute sequential

Both can create children 

Both can be scheduled by the operating system: Both threads and processes can be scheduled by the operating system to execute on the CPU. The operating system is responsible for assigning CPU time to the threads and processes based on various scheduling algorithms.

Both have their own execution context: Each thread and process has its own execution context, which includes its own register set, program counter, and stack. This allows each thread or process to execute independently and make progress without interfering with other threads or processes.

Both can communicate with each other: Threads and processes can communicate with each other using various inter-process communication (IPC) mechanisms such as shared memory, message queues, and pipes. This allows threads and processes to share data and coordinate their activities.

Differences between Threads and Processes –  

 

Resources: Processes have their own address space and resources, such as memory and file handles, whereas threads share memory and resources with the program that created them.

Scheduling: Processes are scheduled to use the processor by the operating system, whereas threads are scheduled to use the processor by the operating system or the program itself.

Creation: The operating system creates and manages processes, whereas the program or the operating system creates and manages threads.

Communication: Because processes are isolated from one another and must rely on inter-process communication mechanisms, they generally have more difficulty communicating with one another than threads do. Threads, on the other hand, can interact with other threads within the same programme directly.


Comments ()


Sign in

Read Next

Predictive Analysis - Ek Overview

Blog banner

Theads

Blog banner

Linux VServer Architecture

Blog banner

Classification Vs Clustring? What's the diffrence?

Blog banner

MODERN OPERATING SYSTEM

Blog banner

I/O Buffering

Blog banner

OS Assignment 1

Blog banner

Race Conditions

Blog banner

The War With Cold On Earth

Blog banner

Elements and Principles of Photography

Blog banner

Linux Virtual Machine Process Scheduling

Blog banner

A-B-C of Networking: Part-2 (Components)

Blog banner

Types of E-Commerce

Blog banner

Life

Blog banner

Broken Authentication Attacks

Blog banner

Memory Management

Blog banner

Deadlock and Starvation

Blog banner

India Digital Personal Data Protection Act, 2023

Blog banner

What is OS Fingerprinting?

Blog banner

Supervised and unsupervised learning

Blog banner

Understanding Univariate, Bivariate, and Multivariate Analysis in Data Science

Blog banner

Automating OSINT tasks for efficient Cyber Forensics Investigations

Blog banner

Why Seasonal Summer Foods Are Best for Your Health?

Blog banner

Principles of Concurrency

Blog banner

Vulnerability Assessment (Vulnerability Analysis)

Blog banner

SPEM

Blog banner

10 Types of Friends in every friend group

Blog banner

Cyber Bullying - Neeta Vonkamuti

Blog banner

Odoo

Blog banner

S-Tool : Steganography

Blog banner

Decision Tree: A Diagram Model

Blog banner

Mesh Topology

Blog banner

A little bit of salt is all the hash needs!

Blog banner

Mental Health

Blog banner

Hey Aryan here

Blog banner

The Essential Guide to Dynamic Arrays vs. Linked Lists: Which to Use and When ?

Blog banner

Deadlock in Operating System

Blog banner

The Features of Blockchain

Blog banner

HubSpot

Blog banner

Smitten Kitchen Keepers

Blog banner

STUDY OF SYSTEM HACKING TOOLS

Blog banner

Music is life

Blog banner