diff --git a/Cargo.lock b/Cargo.lock index 8e370de..1f3fc6d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -276,7 +276,7 @@ dependencies = [ [[package]] name = "threadteam" -version = "0.1.3" +version = "0.2.0" dependencies = [ "libc", "loom", diff --git a/Cargo.toml b/Cargo.toml index e85464b..1b21dc3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "threadteam" -version = "0.1.3" +version = "0.2.0" edition = "2021" license = "MIT OR Apache-2.0" authors = ["Satoshi Terasaki", "Hiroshi Shinaoka"] diff --git a/README.md b/README.md index a919e8f..9069914 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,31 @@ a test binary that runs serial and pooled work and then checks `ledger::global_pool_unstarted()` (with the `rayon` feature it checks that Rayon's process-global pool was never started). +## Upgrading from 0.1 + +0.2 runs entries on threadteam's own worker threads instead of a private Rayon +pool (`docs/design/own-threads.md`). The signatures are those of 0.1 plus +`PoolBuilder::spin_polls` / `Pool::spin_polls`; the behaviour changes are: + +* **Pool drop.** A pool with default thread settings leases *shared* workers + from a process-wide reserve; dropping it waits until every worker detached + and returns them to the reserve, asleep, instead of joining them. A pool with + a `thread_name`, an `on_start` hook, a stack size or a QoS of its own still + gets dedicated workers that its drop joins (their thread-local destructors + have run when `drop` returns). +* **`external` on a team token** lends the members to the pool's own queue. It + no longer runs the callback inside a Rayon pool: Rayon calls in the callback + go to Rayon's global pool. Code that relied on the old behaviour enables the + `rayon` feature and calls `Exec::external_rayon`. +* **`parallel` pulls no Rayon.** Rayon is a dependency only with the `rayon` + feature. +* **`idle_runs_rayon`** has no effect: an idle worker always serves the pool's + queue. It is kept so that callers compile. +* **Waits** follow libgomp (`docs/design/waiting.md`): a bounded spin of + `spin_polls` polls (by default 300000 on x86-64, 2^21 on aarch64), 16 + yields, then sleep. `idle_spin`, `release_idle` and `resident_members` keep + their meaning on the native loop. + ## Wait benchmarks `benches/wait_scenarios.rs` measures how team threads wait, the way callers use them; the design