(Java multithreading) Introduction and multitasking & types of multitasking







what is Multitasking ?

  • Multitasking is the ability to carry out a couple of pastime simultaneously on a pc. we will similarly ruin multitasking into manner based and thread based .


process-based totally Multitasking 

  • process-based multitasking permits methods ( or packages ) to run concurrently on a laptop. as an example , walking unique programs at the same time like downloading a document and printing a document .
  • A process has a self-contained execution environment. A process has a whole , private set of basic resources . every manner has its own memory space.



Thread-based Multitasking

  • Thread-primarily based multitasking lets in exclusive parts of the equal method ( software ) to run simultaneously .
  • a great instance is printing and formatting text in a word processor at the identical time.
  • Thread-primarily based multitasking is most effective viable if the two parts are impartial of each different or greater exactly they are impartial paths of execution at run time.
  • Threads also are referred as light-weight approaches and they also offer an execution environment . Threads exists within a processes and proportion its resources like memory and open files.


we've got numerous benefits of Thread-primarily based multitasking over technique-based totally multitasking .

1. Threads shares the identical address area.
2. Context switching between the threads is much less highly-priced than in strategies.

Share this

Related Posts

Previous
Next Post »