Skip to content
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

Add documentation for parallel_phase feature #1646

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

isaevil
Copy link
Contributor

@isaevil isaevil commented Feb 21, 2025

Description

Document parallel_phase and leave_policy extensions to task_arena in Developer Reference.

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

Signed-off-by: Isaev, Ilya <[email protected]>
Signed-off-by: Isaev, Ilya <[email protected]>
with the following API:
* Add enumeration class ``leave_policy`` to ``task_arena``.
* Add ``leave_policy`` as the last parameter to ``task_arena`` constructors and ``task_arena::initialize`` methods.
This allows to choose retention policy for worker threads in case when no more parallel work in the arena.
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
This allows to choose retention policy for worker threads in case when no more parallel work in the arena.
This allows you to define a retention policy for worker threads when no parallel work is in the arena.

Copy link
Contributor Author

@isaevil isaevil Feb 24, 2025

Choose a reason for hiding this comment

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

I am not sure how to better state this but at the same time to not overwhelm documentation with lots of details. The idea is that the feature allows users to tell the scheduler, what policy to use when TBB's worker threads are going to leave task_arena because they failed to find any work.

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe smth like: This feature allows you to inform the scheduler about the preferred policy for worker threads when they are about to leave task_arena due to a lack of available work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@isaevil isaevil requested a review from aepanchi February 25, 2025 10:43
aepanchi
aepanchi previously approved these changes Feb 27, 2025
Copy link
Contributor

@aepanchi aepanchi left a comment

Choose a reason for hiding this comment

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

Everything looks good just a couple of syntax errors to fix, and it will be good to go.

with the following API:
* Add enumeration class ``leave_policy`` to ``task_arena``.
* Add ``leave_policy`` as the last parameter to ``task_arena`` constructors and ``task_arena::initialize`` methods.
This allows to choose retention policy for worker threads in case when no more parallel work in the arena.
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe smth like: This feature allows you to inform the scheduler about the preferred policy for worker threads when they are about to leave task_arena due to a lack of available work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants