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  Multithreading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark " Multithreading" Watch " Multithreading" New topic
Author

Multithreading

Srinivas Kongara
Greenhorn

Joined: May 07, 2012
Posts: 7


How many ways are there to perform MultiThreading?
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Welcome to the Ranch, kongara srinu!

What do you mean by "how many ways"? What distinguishes one "way" from another in your mind?

Depending on what you mean, the answer could be 1, or it could be 2, or it could be "infinitely many", or it could be some other finite number.

What are you really trying to learn here? What's the purpose behind your question?

Finally, in the future, please UseAMeaningfulSubjectLine(⇐click) so people will know at a glance what you're asking about. Thanks!
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4646
    
    5

Jeff Verdegan wrote:Depending on what you mean, the answer could be 1, or it could be 2, or it could be "infinitely many", or it could be some other finite number.


And, for any given "way", there are probably ten times as many implementations that are incorrect as there are that work properly, scale, and perform as expected.
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

Reminds me of a joke question I heard once ...

"How long is a piece of string?"

To answer the OP, there are standard Java Threads(), Runnable etc. The new TaskExecuters (I think),
Spring framework has it's own implementation etc..

Use the best implementation for the task (lol) at hand.

WP
 
Don't get me started about those stupid light bulbs.
 
subject: Multithreading