stick a fork in it
play

Stick a fork in it An attempt to summarise the Fork-Join framework - PowerPoint PPT Presentation

Stick a fork in it An attempt to summarise the Fork-Join framework through the same titled series of articles by Goetz. Oh, and another article which mentions almost the same thing, only 4 years later. 1 Why another framework? asynchrony


  1. Stick a fork in it An attempt to summarise the Fork-Join framework through the same titled series of articles by Goetz. Oh, and another article which mentions almost the same thing, only 4 years later. � 1

  2. Why another framework? • asynchrony vs. concurrency • finer-grained parallelism � 2

  3. F-i-n-e-r-g-r-a-i-n-e-d P-a-r-a-l-l-e-l-i-s-m • Compute-intensive, • independent tasks • A shift in perf. metric: PU utilisation -> user perception � 3

  4. Divide and conquer � 4

  5. Fork and join nioj join fork fork nioj join nioj join fork fork fork fork � 5

  6. Some classes • ForkJoinTask � RecursiveAction � • RecursiveTask<> � • compute() � • • ForkJoinPool � executor for ForkJoinTask 
 • set of work thieves default constructor adjusts the #threads • according to the #PUs � 6

  7. ParallelArray • a more declarative way (of defining operations on data sets) • similar to SQL queries • filtering, application, mapping, replacement, summarisation • transparent parallelisation Not included in Java 7. May be in 8 � 7

  8. Summary • Fork-Join framework • ideal for divide and conquer • ParallelArray � • uses fork-join under the hood • relieves the programmer of parallelisation duties � 8

  9. Exercise • Implement int BinarySearch(int[] sortedArr, int value) - returns the first occurrence • you can use Arrays.sort to sort an integer array filled with random integers • Experiment with the “sequential threshold”. How does it affect the performance? � 9

  10. Double-click to ask a question • Double-click to discuss � 10

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend