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 Parallel processing vs. multithreading: Java 1.7 fork/join  vs. new Thread() etc. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Parallel processing vs. multithreading: Java 1.7 fork/join  vs. new Thread() etc." Watch "Parallel processing vs. multithreading: Java 1.7 fork/join  vs. new Thread() etc." New topic
Author

Parallel processing vs. multithreading: Java 1.7 fork/join vs. new Thread() etc.

Benjamin Weaver
Ranch Hand

Joined: Apr 08, 2003
Posts: 161
I would like to know whether Java's new fork/join parallel processing functionality is meant to replace Java multithreading, or, rather, supplement it.

I ask because somewhere I read a statement to the effect that functional languages (Haskell, Clojure) represent a more 'reliable' way to achieve the benefits of multithreading than concurrent multithreading itself.

I can at least partially understand this reasoning if it is in fact correct: why not divide into many processes what would have been divided into threads if common resources might be controlled by the process that forks and joins others?
But I could also understand how multithreading might be done on EACH parallel process. By this thinking the result of using fork/join functionality in combination with multithreading would be a multitude of multi-threaded processes.

So, at least in practice, are the two meant, or enabled, to be combined? or does fork/join functionality in Java 1.7 effectively replace concurrency and multithreading in Java?

Any perspective are greatly appreciated! Thanks in advance.

rudra tripathy
Greenhorn

Joined: May 26, 2004
Posts: 25
Hi Benjamin,

There are three things.

fork/join would not replace multi threading, it s just another added advantage. the functional languages are trying to provide distributed features which is better than concurrent, but those are not yet become standards. One who what to implement multi threading features still could use concurrent package.

Hopefully it answers your question.

Regards,
Rudra
Jimmy Mersen
Greenhorn

Joined: May 14, 2013
Posts: 3
Java's basic multi-threading , with Thread, wait etc is simply the lowest level. Higher levels are built on it -- all the libraries in java.util.concurrent, and others. Fork/Join is just one example of what can be built using the lowlevel primitives. In most cases, you indeed do want to use the higher level libraries.
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

I thought fork/join was actually a completely separate mechanism that offered finer-grained control than was possible with the previous mutlithreading constructs. Guess I gotta go read up on Java 7.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Parallel processing vs. multithreading: Java 1.7 fork/join vs. new Thread() etc.