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

Fix current_thread_index for masterless arena(1,0) #1128

Merged

Conversation

pavelkumbrasev
Copy link
Contributor

@pavelkumbrasev pavelkumbrasev commented Jun 12, 2023

Description

A masterless arena(max concurrency = 1, master threads = 0) values might return unexpected tbb::this_task_arena::current_thread_index(), not 0 but 1. That happens because arena preserve additional slot for arenas with max_concurrency == 1 for correct support of enqueue tasks (to ensure that there is a slot for a worker in case of enqueue task submit). However, it is not the case for arena(max concurrency = 1, master threads = 0) because there is a slot for worker thread.

Fixes # - issue number(s) if exists

  • - git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details)

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: pavelkumbrasev <pavel.kumbrasev@intel.com>
Signed-off-by: pavelkumbrasev <pavel.kumbrasev@intel.com>
Copy link
Contributor

@dnmokhov dnmokhov left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@isaevil isaevil left a comment

Choose a reason for hiding this comment

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

LGTM

@pavelkumbrasev pavelkumbrasev merged commit f8f7f73 into master Jun 13, 2023
@pavelkumbrasev pavelkumbrasev deleted the dev/pavelkumbrasev/fix_arena_index_for_masterless_arena branch June 13, 2023 07:54
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