View Feed
group-icon
Java Developers
Community of Java Developers: Get Java Programming Help from fellow Java Developers across the world.
562 Members
Join this group to post and comment.
krishbcs
krishbcs • Feb 22, 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 • Feb 23, 2012
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 • Feb 23, 2012
executing two or more threads concurrently is known as multi threading
krishbcs
krishbcs • Feb 23, 2012
thanks

Share this content on your social channels -