Today we are going to learn the difference between Threads and Processes and how you can clearly distinguish them, supported by Examples. In Computer Science, process is an instance of computer program that is currently being executed, on the other hand, a thread can be considered as a small sequence of programmed instructions that can be managed by scheduler which is part of Operating System
1. Distinguishing between threads and processes
From above definition of thread and process, we can now comfortably show the difference between the two terms. In Computer Science, differentiating does not mean giving definitions but giving a clear definition of the difference between the two terms. Now Distinguish between threads and processes;
Implementation of threads differs between operating systems, but generally, a thread is a component of a process and multiple threads can exist in a single process, sharing same resources like memory, while process does not share these resources.
2. Understanding difference between threads and Processes
Understanding threads and processes from layman’s language: When you start a browser like a google chrome, for example, that’s a process, when you start another software like notepad, that’s another process. For the case of a thread, we can explain it better using the browser, think of the whole browser as a process when you create a tab in the browser, that’s not a process but a thread. Now if you open multiple tabs, you will be running multiple threads in the browser process. As I had mentioned earlier, implementation of threads differs from one operating system to another. For example in some operating systems, threads can exist without process, in some other OS, threads cannot exist without a process.
For the case of examples of threads and processes, have a look at my explanation in section 2 of this article.
We have clearly shown you the difference between threads and processes and their implementations in OS. If you enjoyed my explanation, kindly give cheers in the commenting system below
My name is Benson Karue, I was Software Engineer Telenet Co LTD before I quit and joined YouTube and Udemy as an instructor. I have real-world software experience and have a Bachelor’s degree in Mathematics and Computer Science with 6+ years of coding experience and winning several competitions and coding challenges.