Square CSS

Monday, October 29, 2018

Java Multithreading : Introduction

Multithreading refers to the process of executing multiple threads simultaneously.
A thread can be considered as a smaller unit of processing.
Both multithreading and multiprocessing can be used to achieve multitasking. But in multithreading, threads use shared memory and context switching takes very less time.
Multithreading is mostly used in applications related to games and animations.

Advantages of Multithreading :


  • If any exception occurs in a thread then it doesn't block the other threads or tasks from execution.
  • Multiple tasks can be executed in parallel so it saves time.
  • It doesn't block the user to wait for a particular task to complete as threads are independent of each other.


                    In Java we can create a thread in two ways... 

No comments:

Post a Comment

Some Algorithms

Algorithm: Tower of Hanoi

Tower of Hanoi consists of three towers called as pegs with n number of rings. Rings are of different size.  Conditions to be fulfill...

Popular Posts