Skip to content

When running parallel tasks with fewer than the maximum number of threads, ensure that the thread_id given to the caller's thread function is - #97

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_977778601
Sep 8, 2026
Merged

copybara-service[bot] merged 1 commit into
mainfrom
test_977778601

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Sep 8, 2026

Copy link
Copy Markdown

When running parallel tasks with fewer than the maximum number of threads, ensure that the thread_id given to the caller's thread function is

  • Unique for each thread,
  • In the range [0, pthreadpool_get_threads_count(threadpool)).

This change also fixes a memory-ordering issue where in some cases (with futex on ARM-based machines) not all threads were woken up when requested.

@copybara-service
copybara-service Bot force-pushed the test_977778601 branch 2 times, most recently from 7ede031 to db85807 Compare September 8, 2026 18:15
…eads, ensure that the `thread_id` given to the caller's thread function is

* Unique for each thread,
* In the range `[0, pthreadpool_get_threads_count(threadpool))`.

This change also fixes a memory-ordering issue where in some cases (with `futex` on ARM-based machines) not all threads were woken up when requested.

PiperOrigin-RevId: 978018780
@copybara-service
copybara-service Bot merged commit d9ecbfe into main Sep 8, 2026
17 checks passed
@copybara-service
copybara-service Bot deleted the test_977778601 branch September 8, 2026 18:22
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.

1 participant