Threads are also known as lightweight processes. However, if
we go into depth then we would know that a thread is not actually a process;
rather it provides ways for executing different parts of a program. Now let us
discuss what it actually means by multithreading. Multithreading (as the name
suggests multi+threading) is nothing but an efficient execution of multiple
threads at a time to enhance the performance of the application. For example,
we are doing a file copy operation with a status bar on UI indicating the
completion percentage. Here we need to keep track of how much file size is
copied and at the same time we also need to advance the progress bar
accordingly. This can not be done efficiently in a single thread and you have to
use multiple threads.
The above example shows just one instance where we are
forced to use multithreading. However, when we are not forced we can also use this
for the betterment of the application performance. And of course, all this depends
on how effectively the thread is implemented in an application. Most of the
developers do not use multithreaded applications and continue with a single
thread. However, the efficient use of threads can give birth to a highly
powerful application.