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 Thread's Output can't able to predict Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Thread Watch "Thread New topic
Author

Thread's Output can't able to predict

Sarath Kalangi
Greenhorn

Joined: Nov 01, 2012
Posts: 11
Hi this is basic thread question: I got three threads, when i exectue those three threads i got one output and again i execute i got different output.
why every time the order of output's can't able to predict in threads then it's no use of going to create threads in first point.
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1


Multi-threading is all about concurrent execution.
Thread scheduling and CPU allocation would be architecture/OS dependent and as such beyond the scope of Java (or any other programing language).

The idea is to be able to execute multiple processes concurrently without worrying about the order in which they execute. If the order is a concern in such a situation you might have to look up Thread synchronization and ways to achieve it.

Cheers,
Raj.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Thread's Output can't able to predict
 
Similar Threads
Thread running behaviour
validator
Callin start from run method In case of threads Problem
basic Thread run synch question
Thread