8000 Add implementation details information for task group dynamic dependencies by kboyarinov · Pull Request #1743 · uxlfoundation/oneTBB · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add implementation details information for task group dynamic dependencies #1743

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

Open
wants to merge 12 commits into
base: dev/kboyarinov/tg-rfc-dynamic-dependencies-r2
Choose a base branch
from

Conversation

kboyarinov
Copy link
Contributor

Description

Add RFC describing the implementation of task_group dynamic dependencies.
RFC can be found here: #1664
Implementation:

The document describes the complete implementation

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

kboyarinov and others added 4 commits June 2, 2025 11:15
Co-authored-by: Dmitri Mokhov <dmitri.n.mokhov@intel.com>
…pendencies-r2' into dev/kboyarinov/tg-dynamic-dependencies-impl-rfc

The stored reference counter is increased when:
* `task_dynamic_state` associated with the task is created, the reference is reserved for the task object.
* `task_tracker` instance for the task is created.
Copy link
Contributor

Choose a reason for hiding this comment

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

It is legal to have more than one task_tracker for a task, I think the added "a" implies that there's not just one task_tracker but that you increment the reference count whenever a task_tracker is create. Although maybe it should be made more clear that multiple trackers are allowed for the same task.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have changed it to be "a" and mentioned explicitly that the instance can be a new tracker or a copy.

The stored reference counter is decreased when:
* The associated task is completed, before destroying the task instance
8000 * `task_tracker` instance associated with the task is destroyed
* `task_dynamic_state` of the task that did `transfer_successors_to(new_task)` while executing is destroyed. In this case, the reference
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe its addressed later, but can two tasks transfer successors to the same new_task? If so, "the" should be "a".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replaced with "a"


`m_task` is a pointer to the task, with which the current dynamic state is associated.

`m_successors_list_head` is an atomic pointer to the head of the successor's list of the currently served task. It is also used
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

The stored reference counter is increased when:
* `task_dynamic_state` associated with the task is created, the reference is reserved for the task object.
* a `task_tracker` instance for the task is created (both non-empty tracker created from `task_handle` and copy of the existing one).
* `transfer_successors_to(new_task)` is called, the dynamic state of the currently executing task reserves a reference on the
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* F438 `transfer_successors_to(new_task)` is called, the dynamic state of the currently executing task reserves a reference on the
* `transfer_successors_to(new_task)` is called, the dynamic state of the associated task reserves a reference on the

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would keep currently executing task here since in other places the task associated to the corresponding dynamic state was described. And here the dynamic state associated to the currently executing task (the task that called transfer_successors_to in the body).

When the task `pred1` completes execution, it traverses it's successors list and decreasing the reference counter stored in the vertex
of `succ1` and `succ2`.

When `pred2` traverse it's successors list, it decreases the reference counters in `succ1` and `succ2`. Both of them are equal to `0` now and hence
Copy link
Contributor

Choose a reason for hiding this comment

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

It's probably unimportant but you are assuming that pred1 completes first.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added an explicit mention

kboyarinov and others added 2 commits June 4, 2025 15:56
Co-authored-by: Dmitri Mokhov <dmitri.n.mokhov@intel.com>
Co-authored-by: Mike Voss <michaelj.voss@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0