Skip to content

Conversation

@mpkorstanje
Copy link
Contributor

@mpkorstanje mpkorstanje commented Oct 19, 2025

Depends on #5076.


I hereby agree to the terms of the JUnit Contributor License Agreement.


@mpkorstanje mpkorstanje changed the title Rien/parallel execution custom implementation Skip over unavailable resources in ConcurrentHierarchicalTestExecutorService Oct 19, 2025
@mpkorstanje mpkorstanje force-pushed the rien/parallel-execution-custom-implementation branch from 64322a7 to 452ebbc Compare October 19, 2025 23:02
Base automatically changed from rien/parallel-execution-custom-implementation-reverse-stealing-order to marc/parallel-execution-custom-implementation October 24, 2025 14:29
@marcphilipp marcphilipp force-pushed the rien/parallel-execution-custom-implementation branch from e81d757 to 82fa0c6 Compare October 24, 2025 14:37
Comment on lines -533 to -534
private final EntryOrdering ordering = new EntryOrdering();
private final Queue<Entry> queue = new PriorityBlockingQueue<>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like I forgot to use the custom comparator... 😳

Comment on lines +247 to +248
// One entry at a time to avoid blocking too much
tryToStealWork(entriesRequiringResourceLocks.get(0), BlockingMode.BLOCKING);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please elaborate on this? Is there evidence this is better than doing all of them?

Copy link
Contributor Author

@mpkorstanje mpkorstanje Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After blocking and executing one task, the queue state may have changed and other tasks that don't require blocking may have been added. At the same time the tasks left were known to be blocked. So it makes sense to start the queue processing from the beginning.

Ideally we'd avoid blocking execution here all together. Some other thread owns the resource that blocks these tasks. So they'll get around to the other blocked tasks eventually making the extra workers redundant.

Currently that puts the processQueueEntries into a busy waiting loop and if we do solve that, then we have to find a way to maintain parallelism when we have one big task that claims resources A,B, and C and three smaller tasks that require A, B, C respectively.

@marcphilipp marcphilipp force-pushed the rien/parallel-execution-custom-implementation branch from 82fa0c6 to 63ace09 Compare October 24, 2025 14:59
marcphilipp and others added 4 commits October 24, 2025 17:02
Co-authored-by: Leonard Brünings <lord_damokles@gmx.net>
Co-authored-by: Leonard Brünings <lord_damokles@gmx.net>
@mpkorstanje mpkorstanje marked this pull request as ready for review October 27, 2025 14:42
@mpkorstanje mpkorstanje merged commit b3b1345 into marc/parallel-execution-custom-implementation Oct 27, 2025
12 checks passed
@mpkorstanje mpkorstanje deleted the rien/parallel-execution-custom-implementation branch October 27, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants