Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What kind of stream operations allow us to use .parallel() operation? #609

Open
jkjliang opened this issue Apr 27, 2022 · 4 comments
Open
Labels
📚 Lecture 09 Queries with regards to Lecture 09

Comments

@jkjliang
Copy link

Would just like to get clarification regarding some examples of operations that are allowed> (according to the slides it says they need to be stateless and not interfere with stream data but I'm still not too sure what kind of operations fall under those categories)

image

@jkjliang jkjliang added the 📚 Lecture 09 Queries with regards to Lecture 09 label Apr 27, 2022
@eugenetaan
Copy link

eugenetaan commented Apr 27, 2022

Hi, what i understand is that in general operations that are associative are able to run in parallel. But for stateful operations like sorting where order matters you cant run it in parallel.

Edit:
Yea sorry its associative,
https://stackoverflow.com/questions/45054372/what-do-the-stream-reduce-requirements-exactly-entail,
I think this post explains it pretty well

@Brianliew77
Copy link

Brianliew77 commented Apr 27, 2022

Operations that are associative can run in parallel. Hope this helps

@e0415501
Copy link

It seems that all Streams can run in parallel? When you create a stream, it is always a serial stream unless otherwise specified

@DerrickSaltFish
Copy link

Mostly the operations whose codes of the order of the execution on the elems of the stream doesn't matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 Lecture 09 Queries with regards to Lecture 09
Projects
None yet
Development

No branches or pull requests

5 participants