File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Threads and Synchronization and the fly likes When to use multithreading in business applications Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "When to use multithreading in business applications" Watch "When to use multithreading in business applications" New topic
Author

When to use multithreading in business applications

G Par
Greenhorn

Joined: Jul 11, 2011
Posts: 9
Dear All,
I am a new comer to threading so please bear with my potentially dumb question.
From what I have read in books the main use of threading is that tasks can be run in parallel and slow tasks won't hog the cpu.
But I can't think of practical scenarios in business applications when tasks need to run in parallel.
Most of these books give examples like word processor or printing which are really system applications.
When we talk about business application can somebody give examples of where they have used multithreading to do parallel tasking and how was this justified?

Few things I can imagine
1. Do multi tasking when there are multiple large running queries in your code that are not necessarily related and can be run in parallel
2. Do multi tasking when interfacing with external systems

But if you are not going outside the "boundaries of a java program" are there valid reasons to do multitasking?

THanks
Keith Rainey
Ranch Hand

Joined: Jan 19, 2011
Posts: 66

For instance, you might write a program that needs to check status of many computers on your network. You could do the required tasks for one computer at a time, or you could fire off a bunch of threads with each checking a different computer.


Keith Rainey
OCPJP6
Haina Minawa
Ranch Hand

Joined: Oct 13, 2011
Posts: 119
Multithreading has its own niche and sometimes we couldn't move forward without it. Here is some common tasks that need to be done in multi-threads:

- Avoid GUI freezing when running a long operation in the background, such as compressing files, scan files & directories, ... The background tasks should be executed in separate threads other than the Event Dispatching Thread, otherwise, the GUI will freeze.

- Upload/Download many files at once, this need be done by multi-threads for maximum speed.

.. and much more.
 
 
subject: When to use multithreading in business applications
 
Threads others viewed
Java in the world of Parallel Programming
when not to use thread
Multi-Core Vs. Single-Core (For the serious Java Archs)
Multitasking and Threads
First Java Game - Help REALLY appreciated
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture