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

Seq.duplicate() isn't thread safe #122

Open
lukaseder opened this issue Sep 17, 2015 · 0 comments
Open

Seq.duplicate() isn't thread safe #122

lukaseder opened this issue Sep 17, 2015 · 0 comments

Comments

@lukaseder
Copy link
Member

As correctly stated by Tagir Valeev, the current implementation of Seq.duplicate() isn't thread safe:
http://stackoverflow.com/questions/23860533/copy-a-stream-to-avoid-stream-has-already-been-operated-upon-or-closed-java-8/25961951?noredirect=1#comment53095315_25961951

This is relevant when the stream duplicates are consumed on different threads, which is (ignoring some edge cases) the only reasonable use-case for duplication AND consumption at equal rate.

@lukaseder lukaseder removed this from the Version 0.9.12 milestone Sep 6, 2016
tlinkowski pushed a commit to tlinkowski/jOOL that referenced this issue May 3, 2017
(this implementation is not as memory-conservative as the original - it stores even elements consumed by both Seqs)
tlinkowski pushed a commit to tlinkowski/jOOL that referenced this issue May 11, 2017
[jOOQ#195] Applied SeqBuffer to certain Seq method implementations
[jOOQ#122] Tread-safe Seq.duplicate()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant