What is the definition of the thread ?
For each program executed by the computer, a memory area and some hardware resources are allocated by the operating systems. In computer science, the collection of these resources is defined as process. Each process have at least one independent flow of execution ( or the program flow ) which is named as thread. For a multi-core processor, multiple thread can be executed on real-time and they can share process resources. This situation led to optimal usage of the hardware resources of the computer. A simple illustration about the structure of multi-thread process has been given in the below figures.
Figure: A sample illustration for multi-thread process
There are many tutorials and documents introducing multi-threading in the documents section of these web site. If you want to learn more about multi-threading, you can look the documents given in the document section of this web site.
Why the multithreading is necessary ?
The problems of heat dissipation and energy consumption now limit the ability of hardware manufacturers to speed up chips by increasing their clock rate. This phenomenon has led to a major shift in computer architecture, where single-core CPUs have been replaced by CPUs consisting of a number of processing cores. Therefore, not surprisingly, in order to exploit the full potential of multi-core hardware, there is an unprecedented interest in parallelizing the computing tasks that were previously conducted in series.
This trend forces parallel programming upon the average programmer. Even though there are many way to achieve concurrency in software systems, in general-purpose software engineering practice, we have reached a point where one approach to concurrent programming gains popularity, namely, threads.