• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

When to use multithreading in business applications

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 66
Android IntelliJ IDE Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
I don't like that guy. The tiny ad agrees with me.
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic