Skip to content

threadteam 0.2.0: back to Rayon, reuse the private Rayon pool per width; own threads stay on develop - #21

Merged
shinaoka merged 1 commit into
mainfrom
release/0.2.0-rayon
Oct 29, 2026
Merged

shinaoka merged 1 commit into
mainfrom
release/0.2.0-rayon

Conversation

@shinaoka

Copy link
Copy Markdown
Member

Returns main to the Rayon version and prepares threadteam 0.2.0.

Maintainer decision (2026-10-30): 「0.3.0でいいよ.あと,独自スレッド版はdevelop branchに保存しよう.しばらくはRayon版を出版し続けて,Rayonで何ができないか熟考してから判断する.」

The own-threads version (#16, plus the 0.2.0 version bump of #17) is kept on develop (= 302c37d). If it ships, it ships as 0.3.0.

Closes #20. Supersedes #19, which is closed after this merges.

What changes

  • src/, tests/, docs/, scripts/, benches/ are as on [experiment, do not merge] Reuse the private Rayon pool between pools of one width (faer#107 comparison) #19's 9dfcbdb:

    • Rayon underneath, with libgomp's waits;
    • the per-width cache of the private Rayon pool;
    • bench-ab.sh with the HEAD2 side.

    Ordinary commit on main, no force-push. git diff 9dfcbdb HEAD touches only Cargo.toml, Cargo.lock, README.md and docs/design/placement.md.

  • Removed from main (kept on develop):

    • docs/design/own-threads.md;
    • src/worker.rs;
    • tests/own_threads.rs;
    • the rayon opt-in feature and Exec::external_rayon. These were never published.
  • Version 0.2.0. There are no breaking signatures. cargo public-api diff v0.1.3..HEAD shows additions only:

    • PoolBuilder::spin_polls;
    • Pool::spin_polls.

    The bump is minor because of a contract change: dropping a pool with the default thread settings no longer joins its threads, it caches them.

  • README.

    • A short paragraph on the Rayon pool reuse.
    • The shutdown contract now distinguishes dedicated and default pools.
    • "Upgrading from 0.1" is rewritten for this version:
      • spin_polls is added;
      • the waits follow libgomp;
      • a default pool's drop caches its Rayon pool, and a pool of the same width reuses it, re-applying the caller's CPU set;
      • idle_runs_rayon, external and the parallel → Rayon dependency are unchanged.
  • docs/design/placement.md.

    • The drop paragraph covers the cache.
    • The decision record above, with the link to develop.
  • There is no CHANGELOG in this repository.

Verification (primerose, on 7ee9287)

The pre-push checklist of AGENTS.md, plus more:

  • fmt;
  • clippy with all features and with no default features (-D warnings);
  • cargo test with default features, all features (twice) and no default features;
  • loom: RUSTFLAGS="--cfg loom", 7 models;
  • cargo deny check bans;
  • scripts/check-no-public-rayon.sh;
  • cargo doc with and without all features;
  • cargo check --target aarch64-apple-darwin;
  • taskset -c 0-2, three times: idle_clock, oversubscribed, team, rayon_reuse, team_owner, alloc_free and drop_join;
  • cargo package: 111 files, 238 KB, with the same metadata as 0.1.3.

The CI of #19 on the same sources is green (macOS and Ubuntu tests, loom, clippy, doc, placement rules, rustfmt).

After merge (maintainer-approved)

The monitor merges.

🤖 Generated with Claude Code

…th; libgomp's waits

main returns to the Rayon version of #19 (9dfcbdb): src/, tests/, docs/ and
scripts/ as on that commit. A pool with default thread settings keeps its
Rayon pool in a process-wide per-width cache on drop and the next pool of that
width reuses the threads; waits follow libgomp (spin_polls, 16 yields, sleep).
The own-threads version (#16) stays on `develop` (maintainer decision
2026-10-30); docs/design/own-threads.md leaves main. README "Upgrading from
0.1" rewritten for the Rayon version.

Closes #20. Supersedes #19.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shinaoka shinaoka self-assigned this Oct 29, 2026
@shinaoka
shinaoka merged commit 3f95f61 into main Oct 29, 2026
7 checks passed
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.

Return main to the Rayon version (pool reuse) for 0.2.0; own threads stay on develop

1 participant