where you use thread in your java project?

Answer Posted / sathish reddy

There are many and varied uses for threads.

If your Java application is a server, like a web server,
then you might want to be servicing more than one client at
a time. Thus you may have one thread per client.

An interactive Java application migth need to do something
that takes some time, for example calculate something
complex or drag down data from a server. In this case you
might want to do the time consuming work in one thread while
your user interface is in another thread displaying a
"Working, press Cancel if you want me to stop" dialog.

There are also situations where you need to compute A, B and
C, each of which takes time but can be done in no particular
order. In that case it may be quicker to do them each in
their own thread rather than one after the other.

Until a few years ago processors were getting faster and
faster. Today procesors are pretty much going as fast as
they can with current technology. Instead processors are
being given more and more "cores", each core being able to
run one thread. One of the challenges facing computer
science now is moving to models that better support the
hardware we're now running on.

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the configuration files used in struts?

524


What is life cycle of an interceptor?

546


What is struts framework?

546


How can we group related actions in one group in Struts?

557


What are the main classes which are used in struts application?

496






How is the mvc design pattern used in struts framework?

516


What is the use of interceptor?

518


What is the default suffix for Struts2 action URI and how can we change it?

519


Difference between struts and spring?

581


how to develop the submit and search operations in single jsp using struts?

2556


What are the steps involved in creating a strut application?

510


What configurations are stored in struts configuration file ?

532


Which interceptor is responsible for file upload support?

575


Explain about the future of struts?

531


How can we write our own interceptor and map it for action?

571