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

Refactoring and unifying various thread-related code #310

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

PeterTh
Copy link
Contributor

@PeterTh PeterTh commented Nov 21, 2024

This refactoring PR performs 2 main tasks:

  • Introduce a single source of truth for thread names, and a unified interface to both name and (if enabled and required) pin threads
  • Also unify this with tracy thread ordering, so that there is only a single interface for all of it, and it takes a named_threads enum entry as its parameter

There are no functional changes, test coverage is slightly extended.

Note that the implementation of how the try/catch block in threads is designed and what happens in response to exceptions had already slightly diverged (presumably unintentionally).

Check-perf-impact result (no new file required):
✔️ No significant performance change in the microbenchmark set. You are good to go!

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Clang-Tidy found issue(s) with the introduced code (1/2)

src/platform_specific/named_threads.win.cc Show resolved Hide resolved
src/affinity.cc Outdated Show resolved Hide resolved
include/thread_queue.h Outdated Show resolved Hide resolved
src/platform_specific/affinity.unix.cc Outdated Show resolved Hide resolved
src/named_threads.cc Show resolved Hide resolved
src/named_threads.cc Show resolved Hide resolved
src/named_threads.cc Show resolved Hide resolved
src/named_threads.cc Show resolved Hide resolved
src/backend/sycl_backend.cc Outdated Show resolved Hide resolved
src/backend/sycl_backend.cc Outdated Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Clang-Tidy found issue(s) with the introduced code (2/2)

src/backend/sycl_backend.cc Show resolved Hide resolved
test/named_threads_tests.cc Outdated Show resolved Hide resolved
include/thread_queue.h Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Nov 21, 2024

Pull Request Test Coverage Report for Build 12012369000

Details

  • 59 of 59 (100.0%) changed or added relevant lines in 9 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 94.972%

Totals Coverage Status
Change from base Build 12009901531: 0.05%
Covered Lines: 7062
Relevant Lines: 7169

💛 - Coveralls

@PeterTh PeterTh requested review from psalz and fknorr November 22, 2024 14:30
@PeterTh PeterTh force-pushed the uniform-thread-naming branch from b127bf6 to 7de39cd Compare November 22, 2024 14:37
Copy link
Contributor

@fknorr fknorr left a comment

Choose a reason for hiding this comment

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

I like the centralized naming!

include/affinity.h Outdated Show resolved Hide resolved
include/thread_queue.h Outdated Show resolved Hide resolved
src/named_threads.cc Outdated Show resolved Hide resolved
Copy link
Member

@psalz psalz left a comment

Choose a reason for hiding this comment

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

LGTM!

include/thread_queue.h Outdated Show resolved Hide resolved
src/live_executor.cc Outdated Show resolved Hide resolved
@PeterTh PeterTh force-pushed the uniform-thread-naming branch from 051d708 to e797b17 Compare November 25, 2024 11:43
Copy link

Check-perf-impact results: (32e33781a20e2a3976ece8f7dc81ae2b)

❓ No new benchmark data submitted. ❓
Please re-run the microbenchmarks and include the results if your commit could potentially affect performance.

@celerity celerity deleted a comment from github-actions bot Nov 25, 2024
github-actions[bot]

This comment was marked as resolved.

@PeterTh PeterTh force-pushed the uniform-thread-naming branch 2 times, most recently from e1f9642 to 2193b7d Compare November 25, 2024 12:14
github-actions[bot]

This comment was marked as outdated.

@PeterTh PeterTh force-pushed the uniform-thread-naming branch from 2193b7d to e21469c Compare November 25, 2024 12:43
Copy link
Contributor

@fknorr fknorr left a comment

Choose a reason for hiding this comment

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

Mostly LGTM!

src/named_threads.cc Outdated Show resolved Hide resolved
src/platform_specific/named_threads.unix.cc Show resolved Hide resolved
src/platform_specific/named_threads.unix.cc Outdated Show resolved Hide resolved
src/runtime.cc Outdated Show resolved Hide resolved
- also deduplicate thread body boilerplate
@PeterTh PeterTh force-pushed the uniform-thread-naming branch from e21469c to e820256 Compare November 25, 2024 14:38
@PeterTh PeterTh merged commit e2f4907 into master Nov 25, 2024
17 checks passed
@fknorr fknorr deleted the uniform-thread-naming branch November 26, 2024 04: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.

4 participants