krishbcs
krishbcs
Branch Unspecified
23 Feb 2012

what is multi thread in java?

I want to know what is multi thread in java? I am a computer science engineer. I want to know about it in detail and not just the technical definition. Please explain.
Anoop Kumar

Anoop Kumar

Branch Unspecified
7 years ago
running a more than one segment of a program cuncurrently. basically to use computing resources efficiently .

Why:
you have a program to count 10 sec and read a file and then showing the containt of the file.
Now you have two option.

1.single thread program: count 1-10 sec -->then read file (taking 5 sec to read) -->then show result (taking 2 sec to show out put):
how much time consumed: >(10+5+2) ~ 17 sec

2.Multithreaded: count 1-10 sec and simultaneously read file (taking 5 sec to read) --->then show result (taking 2 sec to show out put):
How much time consumed: >10 sec+2 sec ~ 12sec.




vinci

vinci

Computer Science
7 years ago
executing two or more threads concurrently is known as multi threading
krishbcs

krishbcs

Branch Unspecified
7 years ago
thanks

Share this content on your social channels -

Only logged in users can reply.