wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Threading

profile
Sanket Deora
Jul 15, 2023
0 Likes
0 Discussions
153 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

Time Series Analysis

Blog banner

Dr. Venkadavarahan

Blog banner

What is thread and multithreading ?

Blog banner

Operating Systems Overview

Blog banner

Cloud Computing: Threats and Vulnerabilities

Blog banner

Memory

Blog banner

Why we should do reading

Blog banner

Password Generator - Lisp

Blog banner

Spotify

Blog banner

The Lunchbox That Came Back Untouched — How to Handle a Fussy Eater at Preschool Age

Blog banner

Security and E-mail

Blog banner

Steps to create an Ubuntu EC2 Instance with GUI in AWS

Blog banner

Veg/Non-veg/Egg Tiffin Meals That Are Nutritious and Filling

Blog banner

Memory Management

Blog banner

Mendeley (management software)

Blog banner

Cyber Forensics in Healthcare: Protecting Patient Data and Preventing Breaches

Blog banner

Virtual memory

Blog banner

Cloud Security: Trends and Innovations

Blog banner

Raid and levels of raid.

Blog banner

Device driver

Blog banner

Memory management

Blog banner

Modern Operating System

Blog banner

How to write a cover letter

Blog banner

Data Science in Predictive Analytics: Transforming Business Decision-Making

Blog banner

LINUX

Blog banner

Why Dry Fruits Make the Perfect Gifting Choice for Every Occasion?

Blog banner

A Tourist’s Guide To Florida’s Rodeo Culture: What To Expect At The Arcadia Championship Rodeo

Blog banner

Multicore and multithreading 171

Blog banner

Women Empowerment

Blog banner

Different memory allocation strategies

Blog banner

Perfect Moments to Wear a Rich Patola Design Outfit

Blog banner

Data Science in Healthcare: Predicting Diseases

Blog banner

What is HTML?

Blog banner

Social Media Marketing Trends 2022

Blog banner

How Harshad Valia International School is nurturing India’s Young Minds?

Blog banner

Why Are So Many Adults Getting Diagnosed with ADHD?

Blog banner

Protein and Energy: Why Your Workday Diet Needs More of It

Blog banner

Know your Processors!

Blog banner

What is Amazon?

Blog banner

Understanding the 'Ambiverts'

Blog banner

Hot Mango Pickle (Methiyu)

Blog banner

Virtualisation

Blog banner