In case, you have not had a look at our first article, go through the following link:
Before multithreading, let's talk about some other related concepts.
Multiprogramming
It is the core concept behind multithreading today. Multiprogramming is the ability to load multiple programs into memory and execute them when required. The term multiprogramming is usually used in single processor environments.
The idea of multiprogramming arises from a notion to keep the CPU busy as much as possible. To understand how it works, you can see an example when a program or Job1 is awaiting I/O and then Job2 takes the CPU time and so on to keep the CPU busy.
Multitasking is a natural extension of multiprogramming where all the non-blocked or active jobs are allocated the time on a sharing basis. Multitasking helps to mimic the parallelism by allocating time to all the active jobs.
There are various kinds of algorithms available for time scheduling, for example, Round robin and FIFO.
These days most computers or even smaller devices such as smart phones and tablets are designed to support multitasking. The simplest example of multitasking is running media players, typing emails in Outlook and at the same time, responding to someone in the Lync.
In the following example, Job 2, Job 3 and though to Job n are allocated a time slice based on the selected time scheduling algorithm.
Multiprocessing is the ability of having more than one CPU in a computing machine. Having more than one CPU Core helps to do true parallelism that in turn enhances the performance of calculation-intensive applications.
These days most computers or even smaller devices are loaded with more than one CPU processor or core.
The following example depicts the multiprocessing environment where two CPUs have their own set of jobs to execute.
Now let's talk about multithreading.
Multithreading is a further extension of multitasking where a task or process is again divided into threads.
In a multithreaded environment, threads share the resources of processes but can be executed independently.
Multithreading helps to do abstract concurrent execution and when added with multiprocessing, the execution power multiples and true parallelism can be done.
The example of multithreading could be automatic spell check when writing content in a Word document.
In the following example, you can see that Job 1 is further divided into multiple threads.
There are various kinds of methods available to handle synchronization issues, we will talk about them in future articles.
I hope you liked the article, please share your thoughts/comments.


Prakash TripathiTOP 100Posted Jul 17, 2016, 5:34 AM EDT
Thnx Shoeb.
Shoeb MohammadPosted Jul 17, 2016, 5:06 AM EDT
Great
Prakash TripathiTOP 100Posted May 21, 2016, 2:30 AM EDT
Thnx pouria.
pouria poloukPosted May 21, 2016, 12:50 AM EDT
merc
Prakash TripathiTOP 100Posted Apr 21, 2016, 2:50 AM EDT
Thnx Gowtham.
Gowtham RajamanickamTOP 100Posted Apr 21, 2016, 2:40 AM EDT
very good
Prakash TripathiTOP 100Posted Apr 14, 2016, 6:20 AM EDT
Thnx Ghyath.
Ghyath SerhalPosted Apr 14, 2016, 4:53 AM EDT
Nice
Prakash TripathiTOP 100Posted Mar 6, 2016, 5:31 PM EST
Thnx Kumaresh.
Prakash TripathiTOP 100Posted Mar 6, 2016, 5:31 PM EST
Thnx Karthiga.
Kumaresh RajalingamPosted Mar 6, 2016, 3:26 PM EST
good one
Kumaresh RajalingamPosted Mar 6, 2016, 3:26 PM EST
Nice explanation
Sr KarthigaPosted Mar 6, 2016, 3:14 PM EST
good one
Sr KarthigaPosted Mar 6, 2016, 3:14 PM EST
Nice explanation
Prakash TripathiTOP 100Posted Dec 28, 2015, 12:21 AM EST
Thanks Sibeesh.
Sibeesh VenuTOP 100Posted Dec 28, 2015, 12:17 AM EST
Nice Share
Gowtham RajamanickamTOP 100Posted Dec 28, 2015, 12:10 AM EST
good..
Humayun Kabir MamunPosted Dec 6, 2015, 11:24 PM EST
Nice...
Pankaj Kumar ChoudharyTOP 100Posted Jul 19, 2015, 8:56 AM EDT
Nice One Sir........
Narasimha Reddy ChennupalliPosted Jul 18, 2015, 10:31 AM EDT
Good explanation
Prakash TripathiTOP 100Posted Jun 30, 2015, 9:50 PM EDT
Rahul Saxena.... Thanks Also congrats for becoming Hyd Chapter Lead. Let's plan some event or webinar.
Prakash TripathiTOP 100Posted Jun 30, 2015, 9:43 PM EDT
Sam Hobbs.... Agree with you that there is little variation when considering all the available operating systems in the market. Here we have tried to discuss general or most agreed meaning of these terms. Appreciate your take here. I will try to talk more on this in future articles.
Prakash TripathiTOP 100Posted Jun 30, 2015, 9:28 PM EDT
Thanks all for liking the article. It encouraging :)
Debendra DashPosted Jun 30, 2015, 3:24 AM EDT
good...
Rahul Kumar SaxenaTOP 100Posted Jun 29, 2015, 11:50 PM EDT
good show
Sam HobbsPosted Jun 29, 2015, 3:03 PM EDT
In the context of all operating systems, it is impossible to be precise about these terms. Some operating systems (such as the IBM mainframe MVS family of operating systems) other than Windows use the term task to refer to what is equivalent to a thread in Windows. Also note that there is something called preemptive multitasking. And the term multiprocessing has so many definitions that it is not possible to define it precisely.
Santhakumar MunuswamyPosted Jun 29, 2015, 10:44 AM EDT
Thanks for sharing
Chiheb ChebbiPosted Jun 29, 2015, 6:15 AM EDT
nice keep it up
Sibeesh VenuTOP 100Posted Jun 29, 2015, 2:10 AM EDT
Good one.
Gopi ChandPosted Jun 29, 2015, 12:19 AM EDT
Nice article