File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Context that requires Thread

 
Brian Smith
Ranch Hand
Posts: 232
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
thank.
namaste
 
Dave Landers
Ranch Hand
Posts: 401
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Etc.
 
Steven Daniels
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 336
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
: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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic