A thread is a path which is followed during a program’s execution. Majority of programs written now a days run as a single thread.Lets say, for example a program is not capable of reading keystrokes while making drawings. These tasks cannot be executed by the program at the same time. This problem can be solved through multitasking so that two or more tasks can be executed simultaneously.
Multitasking is of two types: Processor based and thread based. Processor based multitasking is totally managed by the OS, however multitasking through multithreading can be controlled by the programmer to some extent.
The concept of multi-threading needs proper understanding of these two terms – a process and a thread. A process is a program being executed. A process can be further divided into independent units known as threads.
A thread is like a small light-weight process within a process. Or we can say a collection of threads is what is known as a process.
Threading is used widely in almost every field. Most widely it is seen over the internet now days where we are using transaction processing of every type like recharges, online transfer, banking etc. Threading is a segment which divide the code into small parts that are of very light weight and has less burden on CPU memory so that it can be easily worked out and can achieve goal in desired field. The concept of threading is designed due to the problem of fast and regular changes in technology and less the work in different areas due to less application. Then as says “need is the generation of creation or innovation” hence by following this approach human mind develop the concept of thread to enhance the capability of programming.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Benefits of Multithreading in Operating System
- File System Implementation in Operating System
- System Protection in Operating System
- System Programs in Operating System
- Web Operating System
- Inode in Operating System
- Functions of Operating System
- Best-Fit Allocation in Operating System
- Paging in Operating System
- Segmentation in Operating System
- Introduction of Operating System - Set 1
- Thread in Operating System
- Kernel in Operating System
- Bad Block in Operating system
- Concurrency in Operating System
- Deadline scheduler in Operating System
- First In Never Out (FINO) scheduling in Operating System
- File Systems in Operating System
- Virtual Memory in Operating System
- Structures of Directory in Operating System
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.