File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Threads and Synchronization and the fly likes Context that requires Thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Context that requires Thread" Watch "Context that requires Thread" New topic

Context that requires Thread

Brian Smith
Ranch Hand

Joined: Oct 26, 2002
Posts: 232
hi friends,
i am trying to think of real world situation where this Threading is a MUST. could someone please come up and educate me a real world situation that's only solved by Threading?
Dave Landers
Ranch Hand

Joined: Jul 24, 2002
Posts: 401
Web Server has to process requests from lots of clients simultaneously.
Graphical User Interface re-drawing a large <something> without locking up the menus, mouse, buttond.
I am playing an MP3 and yet still I can type.
Speeding up sections of a program where you have a CPU-bound process and an I/O-bound process. If you do them at the same time, the overall speed is increased.
Periodically check for new mail while you are also reading mail and composing a reply and downloading a virus.
Drawing the fly buzzing around the Moose's noze while I am typing this at the same time.
Steven Daniels

Joined: Aug 09, 2002
Posts: 4
I can't think of any example of a program that must use threads. Any program that you make with multiple threads could instead be made with one thread. However, there are many situations where it is more appropriate to use multiple threads.(Some good examples are given in Dave's post above.)
It is like the decision to use loops or recursion. Any algorithm can be implemented using either, but there are some situations where one works out better than the other.
Leslie Chaim
Ranch Hand

Joined: May 22, 2002
Posts: 336
:roll: :roll: Real World situations :roll: :roll:
My very first post to the javaranch was to this forum and I think its a good example.
BTW, I am still waiting for an answer :(
Maybe the gurus are hiding here

Normal is in the eye of the beholder
I agree. Here's the link:
subject: Context that requires Thread
jQuery in Action, 3rd edition