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

Improve performance by doing test-and-test-and-set for spin_mutex #1038

Merged
merged 3 commits into from
Mar 7, 2023

Conversation

dnmokhov
Copy link
Contributor

@dnmokhov dnmokhov commented Mar 1, 2023

Description

In spin mutex lock, add a lock check followed by a backoff before doing a compare-and-swap (which can be highly contended).

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

Type of change

  • 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

@vossmjp @akukanov @pavelkumbrasev @AlexMWells

Other information

Signed-off-by: Dmitri Mokhov <dmitri.n.mokhov@intel.com>
Copy link
Contributor

@pavelkumbrasev pavelkumbrasev left a comment

Choose a reason for hiding this comment

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

Do we need to change copyright year in this file?

src/tbb/spin_mutex.cpp Outdated Show resolved Hide resolved
include/tbb/tbb_machine.h Outdated Show resolved Hide resolved
include/tbb/tbb_machine.h Outdated Show resolved Hide resolved
dnmokhov and others added 2 commits March 2, 2023 17:47
Co-authored-by: Pavel Kumbrasev <pavel.kumbrasev@intel.com>
@dnmokhov dnmokhov merged commit 8a69927 into tbb_2020 Mar 7, 2023
@dnmokhov dnmokhov deleted the dev/dnmokhov/test-and-test-and-set branch March 7, 2023 22:45
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