Threads - Introduction

Before going to concepts of threads, we need to understand the terminology of multitasking.

Task : Is an operation which is performed by the program or the application to provide expected results to the user.

Example: addition of two numbers in a calculator is a task.

Multitasking : Performing multiple tasks simultaneously is called multitasking.

There are two types of Multitasking
a. Process based Multitasking
b. Thread based Multitasking.

Process based Multitasking : Executing each tasks simultaneously where each task is an program or an application which is independent to each other.

Example : We can open IDE in your computer, we can play songs in the Computer, we can open the Messenger in the computer, so computer is doing multiple tasks, but each task is a independent application.

Process based multitasking we can widely see in Operating system level.

Thread based Multitasking : Executing each tasks simultaneously where each task is an independent part of the same application

Example : If you are doing an online transaction, you can see the same program will deduct the money from your account as well as you will receive the SMS or E-Mail of the successful transaction.

Thread based multitasking is best suitable at programmatic level.

The main objective of multitasking is to improve the response time of the application and give better performance of the system.

Threads in Java are very easy to implement when compared to the other legacy programming languages like C,C++ etc. because, Java by default provides rich multi threading API (Threads,Runnable,ThreadGroup).

I am an open source enthusiast. Currently having 6 years of experience and part of Ericsson Global. I am a traveler, Coding manic, Foodie, Gaming Freak and an Amazing Cook.

Share this

Pages
Previous
Next Post »