Friday 28 June 2019

Intruduction of a Thread

Multitasking: Executing several tasks simultaneously is the concept of multitasking. There are two types of multitasking.
    a. Process based multitasking.
    b. Thread based multitasking.


Process based multitasking:
Executing several tasks simultaneously where each task is a separate independent process such type of multitasking is called process based multitasking.
Example:
  • While typing a java program in the editor we can able to listen mp3 audio songs at the same time we can download a file from the net all these tasks are independent of each other and executing simultaneously and hence it is Process based multitasking.
  • This type of multitasking is best suitable at "os level"(Operating System level).

Thread based multitasking:
Executing several tasks simultaneously where each task is a separate independent part of the same program, is called Thread based multitasking.
And each independent part is called a "Thread".
  • This type of multitasking is best suitable for "programmatic level".
  • When compared with "C++", developing multi threading examples is very easy in java because java provides in built support for multi threading through a rich API (Thread, Runnable, ThreadGroup, ThreadLocal...etc).
  • In multi threading on 10% of the work the programmer is required to do and 90% of the work will be down by java API.
  • The main important application areas of multi threading are:
              a. To implement multimedia graphics.
              b. To develop animations.
              c. To develop video games etc.
              d. To develop web and application servers
              e. Whether it is process based or Thread based the main objective of multitasking is to            improve performance of the system by reducing response time.


Thanks..!!

No comments:

Post a Comment