Multi threading in java

Previous
Next

Multi Tasking:

  • Performing more than one task simultaneously.
  • In computer, every instruction execute by the processor.
  • Processor can execute only 1 instruction at a time.
  • When we try to perform multi tasking, processor space will be shared among the tasks.
  • Control UNIT of CPU performs multi tasking using
    • Time slicing
    • Context switching
  • The processor control switches among the tasks to complete.
  • Multi tasking is the concept of maximum utilization of CPU.
  • Performing multi tasking is nothing but applying stress on processor to complete tasks parallel.
  • Following diagram explains clearly how processor executes multiple tasks.

Task v/s Thread:

  • Task is a Program(Process)
  • Thread is a sub program(Sub process)
  • To execute ‘n’ tasks, ‘n’ process spaces required.
  • To execute ‘n’ threads, single process space is required.
  • When we implement threading, that decreases the stress on the processor.
Previous
Next

Add Comment

Courses Enquiry Form