• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Example Applications using Threads  RSS feed

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Folks,
What applications have critical need to use Threads, and manage Threads?
If you can share some application you were involved in, and why Threads were useful (or not useful) that will be great.

I typically build web based applications (EJB's, Servlets) and never need to use Threads.

I guess Applets/Swing apps will use lots of Threads?

Please share your experience & views,
- Avi
 
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With Swing apps it is common to run the keyboard and mouse events on the Swing thread and spawn new threads to do long-running tasks. Printing might be the most familiar example for desktop apps.

It can be challenging to write a UI that makes it clear to the user what's happening and correctly responds to completion of the worker threads, but good clean fun. I have a little app that downloads files and runs as many threads as you ask. Since there is quite a bit of network latency, one thread can run while another is waiting for data.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai i want core java q&a
 
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I typically build web based applications (EJB's, Servlets) and never need to use Threads.


That surprises me. I find that there are plenty of asynchronous or long-running operations where a user cannot be expected to wait for a servlet to respond, or where a servlet might time out.
They also come in handy to schedule nightly jobs or cleanup tasks, where there is no user interaction. Maybe you've used them in the form of java.util.TimerTask?
 
Avianu Sud
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, use TimerTask for those, and usually those are controlled, such as checking for requests and performing operations.

Good point. Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!