mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-01 00:00:10 +02:00
v0.1.x: stage -threadpool 0.1.16 -reactor 0.1.10 releases (#1604)
* upgrade to rand 0.7.0 (MSRV 1.32) * upgrade to parking_lot 0.9.0 * Remove last non-dev dependency on rand crate (#1324) Use std RandomState for XorShift seeding. This allows dropping _rand_ crate dep here, accept as a dev dependency for tests or benchmarks. * increase CI MSRV to 1.31.0 * increase nightly for CI TSAN tests * add TSAN suppressions for recent rand related updates * make latest TSAN suppression patterns more general * upgrade tempfile dev dep for common rand version But avoid tempfile 3.2 for now, since history demonstrates it bumps rand versions and MSRV in MINOR updates. * update (dev dep) env_logger to latest 0.6 * reactor, threadpool: bump PATCH versions, doc links, change logs [ci-release]
This commit is contained in:
committed by
Lucio Franco
parent
59fb5b9a7d
commit
f545d1276b
+1
-1
@@ -91,7 +91,7 @@ jobs:
|
|||||||
- template: ci/azure-check-minrust.yml
|
- template: ci/azure-check-minrust.yml
|
||||||
parameters:
|
parameters:
|
||||||
name: minrust
|
name: minrust
|
||||||
rust_version: 1.28.0
|
rust_version: 1.31.0
|
||||||
|
|
||||||
- template: ci/azure-tsan.yml
|
- template: ci/azure-tsan.yml
|
||||||
parameters:
|
parameters:
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- template: azure-install-rust.yml
|
- template: azure-install-rust.yml
|
||||||
parameters:
|
parameters:
|
||||||
rust_version: nightly-2018-11-18
|
rust_version: nightly-2019-07-17
|
||||||
|
|
||||||
- template: azure-patch-crates.yml
|
- template: azure-patch-crates.yml
|
||||||
- script: |
|
- script: |
|
||||||
|
|||||||
@@ -35,3 +35,10 @@ race:WorkerEntry::set_next_sleeper
|
|||||||
# This ignores a false positive caused by `thread::park()`/`thread::unpark()`.
|
# This ignores a false positive caused by `thread::park()`/`thread::unpark()`.
|
||||||
# See: https://github.com/rust-lang/rust/pull/54806#issuecomment-436193353
|
# See: https://github.com/rust-lang/rust/pull/54806#issuecomment-436193353
|
||||||
race:pthread_cond_destroy
|
race:pthread_cond_destroy
|
||||||
|
|
||||||
|
# Recent rand dependency updates and seeding changes have introduced
|
||||||
|
# lazy_static's and other racy code. See:
|
||||||
|
# https://github.com/tokio-rs/tokio/pull/1358#issuecomment-516172383
|
||||||
|
race:RandomState*::build_hasher
|
||||||
|
race:lazy_static::
|
||||||
|
race:c2_chacha::guts
|
||||||
|
|||||||
+2
-2
@@ -27,8 +27,8 @@ tokio-threadpool = "0.1.3"
|
|||||||
tokio-io = "0.1.6"
|
tokio-io = "0.1.6"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
rand = "0.6"
|
rand = "0.7"
|
||||||
tempfile = ">=3.0.5, <3.1"
|
tempfile = "~3.1.0"
|
||||||
tokio-io = "0.1.6"
|
tokio-io = "0.1.6"
|
||||||
tokio-codec = "0.1.0"
|
tokio-codec = "0.1.0"
|
||||||
tokio = "0.1.7"
|
tokio = "0.1.7"
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
# 0.1.10 (September 25, 2019)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Upgrade to parking_lot 0.9.0 (#1298 backport)
|
||||||
|
- The minimum supported rust version (MSRV) is now 1.31.0. (#1358)
|
||||||
|
|
||||||
# 0.1.9 (March 1, 2019)
|
# 0.1.9 (March 1, 2019)
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ name = "tokio-reactor"
|
|||||||
# - README.md
|
# - README.md
|
||||||
# - Update CHANGELOG.md.
|
# - Update CHANGELOG.md.
|
||||||
# - Create "v0.1.x" git tag.
|
# - Create "v0.1.x" git tag.
|
||||||
version = "0.1.9"
|
version = "0.1.10"
|
||||||
authors = ["Carl Lerche <[email protected]>"]
|
authors = ["Carl Lerche <[email protected]>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
repository = "https://github.com/tokio-rs/tokio"
|
repository = "https://github.com/tokio-rs/tokio"
|
||||||
homepage = "https://tokio.rs"
|
homepage = "https://tokio.rs"
|
||||||
documentation = "https://docs.rs/tokio-reactor/0.1.9/tokio_reactor"
|
documentation = "https://docs.rs/tokio-reactor/0.1.10/tokio_reactor"
|
||||||
description = """
|
description = """
|
||||||
Event loop that drives Tokio I/O resources.
|
Event loop that drives Tokio I/O resources.
|
||||||
"""
|
"""
|
||||||
@@ -27,7 +27,7 @@ lazy_static = "1.0.2"
|
|||||||
log = "0.4.1"
|
log = "0.4.1"
|
||||||
mio = "0.6.14"
|
mio = "0.6.14"
|
||||||
num_cpus = "1.8.0"
|
num_cpus = "1.8.0"
|
||||||
parking_lot = "0.7.0"
|
parking_lot = "0.9.0"
|
||||||
slab = "0.4.0"
|
slab = "0.4.0"
|
||||||
tokio-executor = "0.1.1"
|
tokio-executor = "0.1.1"
|
||||||
tokio-io = "0.1.6"
|
tokio-io = "0.1.6"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Event loop that drives Tokio I/O resources.
|
Event loop that drives Tokio I/O resources.
|
||||||
|
|
||||||
[Documentation](https://docs.rs/tokio-reactor/0.1.9/tokio_reactor)
|
[Documentation](https://docs.rs/tokio-reactor/0.1.10/tokio_reactor)
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@@ -25,10 +25,10 @@ are building a custom I/O resource.
|
|||||||
|
|
||||||
[`mio`]: http://github.com/carllerche/mio
|
[`mio`]: http://github.com/carllerche/mio
|
||||||
[`futures`]: http://github.com/rust-lang-nursery/futures-rs
|
[`futures`]: http://github.com/rust-lang-nursery/futures-rs
|
||||||
[`Reactor`]: https://docs.rs/tokio-reactor/0.1.9/tokio_reactor/struct.Reactor.html
|
[`Reactor`]: https://docs.rs/tokio-reactor/0.1.10/tokio_reactor/struct.Reactor.html
|
||||||
[`Handle`]: https://docs.rs/tokio-reactor/0.1.9/tokio_reactor/struct.Handle.html
|
[`Handle`]: https://docs.rs/tokio-reactor/0.1.10/tokio_reactor/struct.Handle.html
|
||||||
[`Registration`]: https://docs.rs/tokio-reactor/0.1.9/tokio_reactor/struct.Registration.html
|
[`Registration`]: https://docs.rs/tokio-reactor/0.1.10/tokio_reactor/struct.Registration.html
|
||||||
[`PollEvented`]: https://docs.rs/tokio-reactor/0.1.9/tokio_reactor/struct.PollEvented.html
|
[`PollEvented`]: https://docs.rs/tokio-reactor/0.1.10/tokio_reactor/struct.PollEvented.html
|
||||||
[`tokio`]: ../
|
[`tokio`]: ../
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#![doc(html_root_url = "https://docs.rs/tokio-reactor/0.1.9")]
|
#![doc(html_root_url = "https://docs.rs/tokio-reactor/0.1.10")]
|
||||||
#![deny(missing_docs, warnings, missing_debug_implementations)]
|
#![deny(missing_docs, warnings, missing_debug_implementations)]
|
||||||
|
|
||||||
//! Event loop that drives Tokio I/O resources.
|
//! Event loop that drives Tokio I/O resources.
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ fnv = "1.0.6"
|
|||||||
futures = "0.1.19"
|
futures = "0.1.19"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
env_logger = { version = "0.5", default-features = false }
|
env_logger = { version = "0.6", default-features = false }
|
||||||
tokio = { version = "0.1.15", path = "../tokio" }
|
tokio = { version = "0.1.15", path = "../tokio" }
|
||||||
tokio-mock-task = "0.1.1"
|
tokio-mock-task = "0.1.1"
|
||||||
loom = { version = "0.1.1", features = ["futures"] }
|
loom = { version = "0.1.1", features = ["futures"] }
|
||||||
|
|||||||
@@ -28,6 +28,6 @@ iovec = "0.1"
|
|||||||
futures = "0.1.19"
|
futures = "0.1.19"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
env_logger = { version = "0.5", default-features = false }
|
env_logger = { version = "0.6", default-features = false }
|
||||||
net2 = "0.2"
|
net2 = "0.2"
|
||||||
tokio = "0.1.13"
|
tokio = "0.1.13"
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
# 0.1.16 (September 25, 2019)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Remove last non-dev dependency on rand crate by seeding PRNG via libstd
|
||||||
|
`RandomState` (#1324 backport)
|
||||||
|
- Upgrade (dev-only dependency) rand to 0.7.0 (#1302 backport)
|
||||||
|
- The minimum supported rust version (MSRV) is now 1.31.0 (#1358)
|
||||||
|
|
||||||
# 0.1.15 (June 2, 2019)
|
# 0.1.15 (June 2, 2019)
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ name = "tokio-threadpool"
|
|||||||
# - README.md
|
# - README.md
|
||||||
# - Update CHANGELOG.md.
|
# - Update CHANGELOG.md.
|
||||||
# - Create "v0.1.x" git tag.
|
# - Create "v0.1.x" git tag.
|
||||||
version = "0.1.15"
|
version = "0.1.16"
|
||||||
documentation = "https://docs.rs/tokio-threadpool/0.1.14/tokio_threadpool"
|
documentation = "https://docs.rs/tokio-threadpool/0.1.16/tokio_threadpool"
|
||||||
repository = "https://github.com/tokio-rs/tokio"
|
repository = "https://github.com/tokio-rs/tokio"
|
||||||
homepage = "https://github.com/tokio-rs/tokio"
|
homepage = "https://github.com/tokio-rs/tokio"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
@@ -27,12 +27,13 @@ crossbeam-deque = "0.7.0"
|
|||||||
crossbeam-queue = "0.1.0"
|
crossbeam-queue = "0.1.0"
|
||||||
crossbeam-utils = "0.6.4"
|
crossbeam-utils = "0.6.4"
|
||||||
num_cpus = "1.2"
|
num_cpus = "1.2"
|
||||||
rand = "0.6"
|
|
||||||
slab = "0.4.1"
|
slab = "0.4.1"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
|
lazy_static = "1"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
env_logger = "0.5"
|
rand = "0.7"
|
||||||
|
env_logger = { version = "0.6", default-features = false }
|
||||||
|
|
||||||
# For comparison benchmarks
|
# For comparison benchmarks
|
||||||
futures-cpupool = "0.1.7"
|
futures-cpupool = "0.1.7"
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
A library for scheduling execution of futures concurrently across a pool of
|
A library for scheduling execution of futures concurrently across a pool of
|
||||||
threads.
|
threads.
|
||||||
|
|
||||||
[Documentation](https://docs.rs/tokio-threadpool/0.1.15/tokio_threadpool)
|
[Documentation](https://docs.rs/tokio-threadpool/0.1.16/tokio_threadpool)
|
||||||
|
|
||||||
### Why not Rayon?
|
### Why not Rayon?
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#![doc(html_root_url = "https://docs.rs/tokio-threadpool/0.1.15")]
|
#![doc(html_root_url = "https://docs.rs/tokio-threadpool/0.1.16")]
|
||||||
#![deny(warnings, missing_docs, missing_debug_implementations)]
|
#![deny(warnings, missing_docs, missing_debug_implementations)]
|
||||||
|
|
||||||
//! A work-stealing based thread pool for executing futures.
|
//! A work-stealing based thread pool for executing futures.
|
||||||
@@ -84,8 +84,9 @@ extern crate crossbeam_queue;
|
|||||||
extern crate crossbeam_utils;
|
extern crate crossbeam_utils;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate futures;
|
extern crate futures;
|
||||||
|
#[macro_use]
|
||||||
|
extern crate lazy_static;
|
||||||
extern crate num_cpus;
|
extern crate num_cpus;
|
||||||
extern crate rand;
|
|
||||||
extern crate slab;
|
extern crate slab;
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ use worker::{self, Worker, WorkerId};
|
|||||||
use futures::Poll;
|
use futures::Poll;
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
use std::collections::hash_map::RandomState;
|
||||||
|
use std::hash::{BuildHasher, Hash, Hasher};
|
||||||
use std::num::Wrapping;
|
use std::num::Wrapping;
|
||||||
use std::sync::atomic::AtomicUsize;
|
use std::sync::atomic::AtomicUsize;
|
||||||
use std::sync::atomic::Ordering::{AcqRel, Acquire};
|
use std::sync::atomic::Ordering::{AcqRel, Acquire};
|
||||||
@@ -25,7 +27,6 @@ use std::thread;
|
|||||||
|
|
||||||
use crossbeam_deque::Injector;
|
use crossbeam_deque::Injector;
|
||||||
use crossbeam_utils::CachePadded;
|
use crossbeam_utils::CachePadded;
|
||||||
use rand;
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub(crate) struct Pool {
|
pub(crate) struct Pool {
|
||||||
@@ -420,11 +421,7 @@ impl Pool {
|
|||||||
/// Uses a thread-local random number generator based on XorShift.
|
/// Uses a thread-local random number generator based on XorShift.
|
||||||
pub fn rand_usize(&self) -> usize {
|
pub fn rand_usize(&self) -> usize {
|
||||||
thread_local! {
|
thread_local! {
|
||||||
static RNG: Cell<Wrapping<u32>> = {
|
static RNG: Cell<Wrapping<u32>> = Cell::new(Wrapping(prng_seed()));
|
||||||
// The initial seed must be non-zero.
|
|
||||||
let init = rand::random::<u32>() | 1;
|
|
||||||
Cell::new(Wrapping(init))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RNG.with(|rng| {
|
RNG.with(|rng| {
|
||||||
@@ -448,3 +445,31 @@ impl PartialEq for Pool {
|
|||||||
|
|
||||||
unsafe impl Send for Pool {}
|
unsafe impl Send for Pool {}
|
||||||
unsafe impl Sync for Pool {}
|
unsafe impl Sync for Pool {}
|
||||||
|
|
||||||
|
// Return a thread-specific, 32-bit, non-zero seed value suitable for a 32-bit
|
||||||
|
// PRNG. This uses one libstd RandomState for a default hasher and hashes on
|
||||||
|
// the current thread ID to obtain an unpredictable, collision resistant seed.
|
||||||
|
fn prng_seed() -> u32 {
|
||||||
|
// This obtains a small number of random bytes from the host system (for
|
||||||
|
// example, on unix via getrandom(2)) in order to seed an unpredictable and
|
||||||
|
// HashDoS resistant 64-bit hash function (currently: `SipHasher13` with
|
||||||
|
// 128-bit state). We only need one of these, to make the seeds for all
|
||||||
|
// process threads different via hashed IDs, collision resistant, and
|
||||||
|
// unpredictable.
|
||||||
|
lazy_static! {
|
||||||
|
static ref RND_STATE: RandomState = RandomState::new();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hash the current thread ID to produce a u32 value
|
||||||
|
let mut hasher = RND_STATE.build_hasher();
|
||||||
|
thread::current().id().hash(&mut hasher);
|
||||||
|
let hash: u64 = hasher.finish();
|
||||||
|
let seed = (hash as u32) ^ ((hash >> 32) as u32);
|
||||||
|
|
||||||
|
// Ensure non-zero seed (Xorshift yields only zero's for that seed)
|
||||||
|
if seed == 0 {
|
||||||
|
0x9b4e_6d25 // misc bits, could be any non-zero
|
||||||
|
} else {
|
||||||
|
seed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -28,6 +28,6 @@ crossbeam-utils = "0.6.0"
|
|||||||
slab = "0.4.1"
|
slab = "0.4.1"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
rand = "0.6"
|
rand = "0.7"
|
||||||
tokio-mock-task = "0.1.0"
|
tokio-mock-task = "0.1.0"
|
||||||
tokio = "0.1.7"
|
tokio = "0.1.7"
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ tokio-io = "0.1.7"
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tokio = "0.1"
|
tokio = "0.1"
|
||||||
cfg-if = "0.1"
|
cfg-if = "0.1"
|
||||||
env_logger = { version = "0.5", default-features = false }
|
env_logger = { version = "0.6", default-features = false }
|
||||||
|
|
||||||
[target.'cfg(all(not(target_os = "macos"), not(windows), not(target_os = "ios")))'.dev-dependencies]
|
[target.'cfg(all(not(target_os = "macos"), not(windows), not(target_os = "ios")))'.dev-dependencies]
|
||||||
openssl = "0.10"
|
openssl = "0.10"
|
||||||
|
|||||||
@@ -29,4 +29,4 @@ log = "0.4"
|
|||||||
futures = "0.1.19"
|
futures = "0.1.19"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
env_logger = { version = "0.5", default-features = false }
|
env_logger = { version = "0.6", default-features = false }
|
||||||
|
|||||||
@@ -33,4 +33,4 @@ tokio-io = "0.1.6"
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tokio = "0.1.6"
|
tokio = "0.1.6"
|
||||||
tempfile = ">=3.0.5, <3.1"
|
tempfile = "~3.1.0"
|
||||||
|
|||||||
+1
-1
@@ -82,7 +82,7 @@ mio = { version = "0.6.14", optional = true }
|
|||||||
tokio-uds = { version = "0.2.1", optional = true }
|
tokio-uds = { version = "0.2.1", optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
env_logger = { version = "0.5", default-features = false }
|
env_logger = { version = "0.6", default-features = false }
|
||||||
flate2 = { version = ">=1.0.2, <1.0.10", features = ["tokio"] }
|
flate2 = { version = ">=1.0.2, <1.0.10", features = ["tokio"] }
|
||||||
futures-cpupool = "0.1"
|
futures-cpupool = "0.1"
|
||||||
http = "0.1"
|
http = "0.1"
|
||||||
|
|||||||
Reference in New Issue
Block a user