• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic