0

We're having this issue: SLURM slow for array job

Is there some way that

collection.stream().someFunction1().someFunction2() etc.

or

Arrays.stream(values).someFunction1().someFunction2() etc.

does cause some multithreading?

We don't have anything like "parallel" or "thread" in our code.

Thanks in advance

Martin

5
  • 8
    No.. Unless you do something like that (creating threads) within your someFunction1 or someFunction2. Commented Sep 4, 2018 at 12:48
  • 3
    And what is stream.someFunction1() exactly? Must we suppose map()? Commented Sep 4, 2018 at 12:49
  • It can, if you have parallel stream. Commented Sep 4, 2018 at 12:51
  • someFunctionX are filter(), map(), findFirst(), count(), sum(), collect(), etc. We didn't include any parallelism ourselves, and also don't have parallelStream() or similar. Commented Sep 4, 2018 at 13:15
  • And also forEach() Commented Sep 4, 2018 at 13:22

1 Answer 1

2

No.

From the documentation for Collection.stream:

Returns a sequential Stream with this collection as its source.

From the documentation for Arrays.stream:

Returns a sequential Stream with the specified array as its source.

A sequential stream is the opposite of a parallel stream. It is processed in the calling thread only.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.