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

Method of Evaluating Information Security Level in an Organization

Blog banner

Balance

Blog banner

10 Interesting Facts about Death Note

Blog banner

Memory Management

Blog banner

What Function Does SEO Serve in Digital Marketing?

Blog banner

Video games

Blog banner

Service Catalogue Management

Blog banner

USPS mail

Blog banner

Steganography

Blog banner

Deadlock and Starvation

Blog banner

Monday. com App

Blog banner

Processes : Process description and control

Blog banner

Tableau

Blog banner

Working with Sniffers for monitoring network communication

Blog banner

Every body is beautiful

Blog banner

Time Series Analysis

Blog banner

'Positivity in life'

Blog banner

Bitcoin sent using radio waves! No internet!

Blog banner

Fitness regime by Deepesh

Blog banner

Telegram and it's features

Blog banner

Dekkers Algorithm

Blog banner

The Peephole

Blog banner

The launch of UniMap by HERE

Blog banner

Digital Footprints An Emerging Dimension of Digital Inequality

Blog banner

Cyber Crime Investigation In The Era Of Big Data

Blog banner

Virtual Machine's

Blog banner

Threads Concurrency: Mutual Exclusion and Synchronization

Blog banner

Use case of K-means clustering

Blog banner

Gamer life

Blog banner

Steganography and Steganalysis

Blog banner

Supervised and Unsupervised Learning

Blog banner

Steps to create an Ubuntu EC2 Instance with GUI in AWS

Blog banner

OPERATING SYSTEM

Blog banner

Why Time Management Is the Secret to College Success (and How to Master It)

Blog banner

Data Science in Everyday Life (like a phone, shopping cart, or social media icons)

Blog banner

The Art of Slow Fashion: Why Patola Defines Sustainable Luxury

Blog banner

MULTITHREADING:ENHANCEING PERFORMANCE AND EFFICIENCY IN COMPUTING

Blog banner

From Procrastinator to Performer: How to Beat the Last-Minute Rush

Blog banner

Mumbaicha Dabbawalla

Blog banner

My favourite food

Blog banner

Sweet Mango Murabba

Blog banner

MD5 Collisions and the impact on computer forensics

Blog banner