[concurrency-interest] Fork/Join Use cases

Joe Bowbeer joe.bowbeer at gmail.com
Fri Dec 12 03:38:25 EST 2014


Richard,

My example is real-world, though it's not particularly elegant.  I ported
Hector Yee's Perceptual Diff from C to Java, and yet, after I tried all the
optimization tricks I could manage, the C code still outperformed the Java
code.  Darn!  So the only avenue left for me was to call on FJP, and the
resulting code outperformed C even on a dual-core laptop:

https://bitbucket.org/joebowbeer/perceptualdiff

Check out the RecursiveTask implementation in the PerceptualDiff class.

--Joe

On Thu, Dec 11, 2014 at 6:16 PM, Richard Warburton <
richard.warburton at gmail.com> wrote:

> Hi,
>
> Something I have noticed with fork/join is the absence of clear-cut and
> common motivating examples and use cases. Many times people provide
> examples of fork/join code that only solves a simple problem. For example
> calculates Fibonacci numbers or performs a merge sort. This is great for
> the educational purpose of understanding the API but isn't so convincing of
> the efficacy of fork/join as a general parallel programming framework.
>
> What I would like to see is an example of a more complex use of fork join.
> For example something like training a neural network. Now its that I can't
> see how such a problem don't fit into the fork/join model - but the
> question is why one would conclude it to be such a general model as to
> warrant inclusion into Java SE. Other than problems whose algorithms
> naturally follow a recursive structure (eg fibonacci) everytime I try to
> fit a parallel programming problem into the fork/join model in my head it
> doesn't seem to offer me much over the ability to run a series of parallel
> threads.
>
> I'm ruling out the simpler problems alone because implementing such tasks
> in parallel is often not difficult enough to warrant a framework or of
> particular use. I'm not looking for:
>
> a. Other parallel programming frameworks which depend upon fork/join (eg:
> parallel streams). I'm asking for actual direct application level usage of
> fork/join.
>
> b. Other models - I'm just asking about fork/join.
>
> c. Fitting problems into fork/join which can be made to work but either
> have as code that's as complex as using threads or have poor performance.
> The ideal example would have also some kind of open source code with
> comparisons in other approaches, but I appreciate I'm asking for a lot here
> when trying to satisfy my own understanding.
>
> regards,
>
>   Richard Warburton
>
>   http://insightfullogic.com
>   @RichardWarburto <http://twitter.com/richardwarburto>
>
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20141212/fa546ba1/attachment.html>


More information about the Concurrency-interest mailing list