#77 SpliteratorUtils#limit for parallel stream

닫힘
ranides4 년 전을 오픈 · 2개의 코멘트
ranides 코멘트됨, 4 년 전

Parallel stream limit has undefined behaviour.

Probably "stop condition" won't work at all, because parallel threads wont even notice, that some thread rejected some value. At this moment LimitSpliterator is not prepared for parallel executions at all: it uses default split method which buffers results.

Parallel stream limit has undefined behaviour. Probably "stop condition" won't work at all, because parallel threads wont even notice, that some thread rejected some value. At this moment LimitSpliterator is not prepared for parallel executions at all: it uses default split method which buffers results.
ranides 코멘트됨, 3 년 전
소유자

To be honest, our current, default method "trySplit" uses condition all the time and preserves condition?

To be honest, our current, default method "trySplit" uses condition all the time and preserves condition?
ranides 커밋 3 년 전에서 이 이슈 언급
ranides 코멘트됨, 3 년 전
소유자

bulshit, not a bug.

It works perfectly for parallel list, and hashset, and even IntStream. I have no idea what should be done to generate wrong results.

Spliterator has well defined contract and default implementation of LimitSpliterator gives perfect semantic although limited paralelization.

Limited paralelization means that "filtering" is done internally in single thread, but all other pipeline steps are still parallel. In fact that's exactly what we want to achieve.

bulshit, not a bug. It works perfectly for parallel list, and hashset, and even IntStream. I have no idea what should be done to generate wrong results. Spliterator has well defined contract and default implementation of LimitSpliterator gives perfect semantic although limited paralelization. Limited paralelization means that "filtering" is done internally in single thread, but all other pipeline steps are still parallel. In fact that's exactly what we want to achieve.
로그인하여 이 대화에 참여
마일스톤 없음
담당자 없음
참여자 1명
로딩중...
취소
저장
아직 콘텐츠가 없습니다.