#77 SpliteratorUtils#limit for parallel stream

Geschlossen
vor 4 Jahren geöffnet von ranides · 2 Kommentare
ranides kommentierte vor 4 Jahren

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 kommentierte vor 3 Jahren
Besitzer

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 hat vor 3 Jahren geschlossen
ranides hat dieses Issue vor 3 Jahren aus einem Commit referenziert
ranides kommentierte vor 3 Jahren
Besitzer

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.
Anmelden, um an der Diskussion teilzunehmen.
Kein Meilenstein
Niemand zuständig
1 Beteiligte
Laden…
Abbrechen
Speichern
Hier gibt es bis jetzt noch keinen Inhalt.