Skip to content

Conversation

@kboyarinov
Copy link
Contributor

Description

Task Group Dynamic Dependencies broke the case when an empty task_handle is bypassed.
Current documentation do not explicitly allow it, but it is needed to implement constructions like below:

class group_task {
    tbb::task_handle operator()() const {
        if (range-too-small) {
            // Do serial work
            return tbb::task_handle{}; // nothing to bypass, but the operator signature forces to return something
        } else {
            // Split work and run in parallel
            tbb::task_handle left = tg.defer(left-subtask);
            tbb::task_handle right = tg.defer(right-subtask);
            
            // Submit the right part
            tg.run(std::move(right);
            
            // Bypass the left part
            return left;
        }
    }
};

Fixes # - issue number(s) if exists

Type of change

Choose one or multiple, leave empty if none of the other choices apply

Add a respective label(s) to PR if you have permissions

  • bug fix - change that fixes an issue
  • new feature - change that adds functionality
  • tests - change in tests
  • infrastructure - change in infrastructure and CI
  • documentation - documentation update

Tests

  • added - required for new features and some bug fixes
  • not needed

Documentation

  • updated in # - add PR number
  • needs to be updated
  • not needed

Breaks backward compatibility

  • Yes
  • No
  • Unknown

Notify the following users

List users with @ to send notifications

Other information

Copy link
Contributor

@vossmjp vossmjp left a comment

Choose a reason for hiding this comment

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

Looks good to me

@kboyarinov kboyarinov merged commit 3df32aa into master Oct 5, 2025
30 checks passed
@kboyarinov kboyarinov deleted the dev/kboyarinov/tg-fix-return-empty-handle branch October 5, 2025 14:43
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