https://github.com/shubh2-0/multi-threading
Multithreading is a Java feature that allows concurrent execution of two or more parts of a program for maximum utilization of CPU. Each part of such program is called a thread. So, threads are light-weight processes within a process.
https://github.com/shubh2-0/multi-threading
core-java-concepts java multithreading spring
Last synced: 28 days ago
JSON representation
Multithreading is a Java feature that allows concurrent execution of two or more parts of a program for maximum utilization of CPU. Each part of such program is called a thread. So, threads are light-weight processes within a process.
- Host: GitHub
- URL: https://github.com/shubh2-0/multi-threading
- Owner: Shubh2-0
- Created: 2023-02-05T02:51:43.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-05T08:31:58.000Z (about 1 year ago)
- Last Synced: 2025-04-18T05:53:49.073Z (about 1 month ago)
- Topics: core-java-concepts, java, multithreading, spring
- Language: Java
- Homepage:
- Size: 31.3 KB
- Stars: 10
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Multi-Threading 🔄️
Unlike many other programming languages, Java provides built-in support for multithreaded programming. Multithreaded programming contains two or more parts that can run concurrently. Each piece of such a program is called a thread, and each thread defines a separate path of execution. Thus multithreading can be said as a particular version of multitasking.
# What is Multithreading ?
The process of executing multiple tasks (also called threads) simultaneously is called multithreading. The primary purpose of multithreading is to provide simultaneous execution of two or more parts of a program to make maximum use of CPU time. A multithreaded program contains two or more parts that can run concurrently. It enables programmers to write in a way where multiple activities can proceed simultaneously within a single application.# What is Multitasking ?
It is the way of executing multiple tasks at a time executing them concurrently over a specified period. Multitasking is done in two ways.
**These are:-**
1️⃣ Process-based multitasking: It is also called multiprocessing where each process has its address in memory, i.e., each process allocates separate memory area.\
2️⃣ Thread-based multitasking: This thread-based multitasking is also termed as multithreading where threads share the same address spac.# Life Cycle of a Thread 🧬
A thread goes through various stages of its life cycle. Example, first of all, a thread is born, started its tasks, run a sequence of tasks concurrently, and then dies. Here is the diagram of the various stages of a life cycle.
## 📬 Contact
If you want to contact me, you can reach me through below handles.