1

Official Oracle documentation says:

Another implementation of the fork/join framework is used by methods in the java.util.streams package

The only public classes I have found there are AbstractTask and AbstractShortCircuitTask and it is abstract.

And I haven't found and ForkJoinPool implemenentation.

Question: so does it mean that we don't have any manual access to fork/join process in Stream API and cannot not use this implementation directly?

Sergii Getman
  • 3,845
  • 5
  • 34
  • 50
  • 4
    The [ForkJoinPool](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ForkJoinPool.html) instance that is used by default is the [common pool](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ForkJoinPool.html#commonPool--) and you can access that. The documentation you are referring to is outdated or misleading. Also, there is no `java.util.sream.op` package in the final implementation. – Stefan Zobel Nov 10 '16 at 08:57
  • 2
    @SergiiGetman Looks like you are looking for this: http://stackoverflow.com/questions/21163108/custom-thread-pool-in-java-8-parallel-stream – Eugene Nov 10 '16 at 09:01
  • StefanZobel, Eugene - thanks guys,i'll check it – Sergii Getman Nov 10 '16 at 09:06
  • 2
    This is a misleading wording. There is no “*another implementation of the fork/join framework*”. The Stream API just uses the Fork/Join framework, just like `parallelSort()`, as mentioned in the previous paragraph, uses F/J, but that doesn’t mean that there is anything related to F/J in the API. There are some related side effects due to the use of this framework, however, every developer should keep in mind that this is an (officially) unspecified implementation detail. – Holger Nov 10 '16 at 11:39
  • See also [Where does official documentation say that Java's parallel stream operations use fork/join?](https://stackoverflow.com/questions/24629247/where-does-official-documentation-say-that-javas-parallel-stream-operations-use) – Vadzim Jun 28 '18 at 23:13

0 Answers0