Multithreading:
Having multithreaded support built into the language will be new to you if you are like most programmers. A key to utilizing this support efficiently is to think parallel rather than serially. For instance, when you have two subsystems inside a program which can execute concurrently, make them individual threads. Along with the careful use for multithreading, you could create extremely efficient programs. A word of caution is in sequence, Although, if you create too several threads, you can in fact degrade the performance of your program rather than enhance it. Note that some overhead is related within context switching. More CPU time will be spent modifying contexts than executing your program if you create too many threads!
Java gives built-in support for multithreaded programming. The multithread program holds two or more parts which can run concurrently. Every part of such a program is known as a thread, and every thread declare a separate path of execution. Therefore, multithreading is a specialized form of multitasking.
Multitasking:
You are almost certainly familiar along with multitasking, since it it's supported through virtually all modern operating systems. However, there are two distinct types of multitasking: process-based and thread-based. It is important to understand the difference between the two. For most readers, process-based multitasking is the more familiar form. The process is, in essence, a program which is executing. Therefore process-based multitasking is the characteristic which permits your computer to run two or more programs concurrently. For instance, process-based multitasking enables you to run the Java compiler at the similar time which you are using a text editor. Within process- based multitasking, a program is the smallest unit of code which can be dispatched through the scheduler.