Multithreading

Multithreading:

     Multithreading is the ability of a program or an operating system to serve more than one user at a time and to manage multiple simultaneous requests without the need to have multiple copies of the programs running within the computer.

Thread:

     A lightweight sub process and a small unit of processing.

Multitasking:

     Multitasking is used to runs simultaneous tasks. Two types available to achieve the Multitasking.

Two types:

  1. Multithreading
  2. Multiprocessing

Multiprocessing:

          Multitasking is a process based Multi-Process.
          Each process allocate the separate memory location.
          Process is heavy weight.
          The switching of process require high time(saving and loading of Registry)
          Communication between process is high cost.

Multithreading:
     
           Multitasking based on the Multi-thread.
           Multithreading shares the same memory locations.
           Process is lite weight.
           Communication between thread is low cost. 

Based on the above, the programmer choice is Multithreading.

Process and Thread

          People's are argue that Process and the Thread are same. But the Process and Thread both are not same. A process contains threads. For example, the word is a example of the process, spell checker, highlighting are the example of the thread.


          

1 comment:

  1. Navidha: very simple and helpful for my interview point of view


    Thanks

    ReplyDelete