wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Threading

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

PPC Advertising and its Impressive Benefits

Blog banner

Virtual Memory

Blog banner

geographic information system (GIS)

Blog banner

Assignment-3

Blog banner

Pipedrive

Blog banner

Why Soft Skills Matter as Much as Grades?

Blog banner

Deadlock

Blog banner

What is Email? Uses of Emails

Blog banner

Dental Problems That Start Small But Should Never Be Ignored

Blog banner

Steganography and Steganalysis

Blog banner

EFT

Blog banner

Lifestyle of a photographer

Blog banner

Multicore and multithreading 171

Blog banner

How Schools Can Reduce Exam Stress in Students?

Blog banner

MQTT (MQ Telemetry Transport) in Data Science

Blog banner

Deadlocks in operating system

Blog banner

Types of Threads

Blog banner

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

Blog banner

Sensory Play for Toddlers: Boosting Curiosity Through Touch, Sound, and Colour

Blog banner

Photorec - media recovery tool

Blog banner

**THE MUJAWARR: Transforming the Logistics Industry**

Blog banner

Memory Management in Operating System

Blog banner

Malware

Blog banner

Why Moms Are Choosing Customised School Accessories Over Generic Products?

Blog banner

TRELLO

Blog banner

Cyber Security Control

Blog banner

Little Habits, Big Impact: Daily Preschool Routines That Shape the Future

Blog banner

E-BUSINESS RISK MANAGEMENT

Blog banner

Self managing devices

Blog banner

Firewall in Computer Network

Blog banner

Deadlock

Blog banner

Volatile Memory & Non-Volatile Memory Explained

Blog banner

ADIDAS

Blog banner

INTERNET SECURITY

Blog banner

Unlocking the Secrets: Basic Operations of Computer Forensic Laboratories

Blog banner

BharatPe

Blog banner

Modern Operating Systems

Blog banner

Virtualization

Blog banner

This too shall pass

Blog banner

Cryptanalysis tool

Blog banner

Cache memory

Blog banner

Virtual Machine

Blog banner