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:
David Kellum
2019-09-30 14:21:56 -04:00
committed by Lucio Franco
parent 59fb5b9a7d
commit f545d1276b
20 changed files with 81 additions and 33 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ jobs:
- template: ci/azure-check-minrust.yml
parameters:
name: minrust
rust_version: 1.28.0
rust_version: 1.31.0
- template: ci/azure-tsan.yml
parameters:
+1 -1
View File
@@ -12,7 +12,7 @@ jobs:
steps:
- template: azure-install-rust.yml
parameters:
rust_version: nightly-2018-11-18
rust_version: nightly-2019-07-17
- template: azure-patch-crates.yml
- script: |
+7
View File
@@ -35,3 +35,10 @@ race:WorkerEntry::set_next_sleeper
# This ignores a false positive caused by `thread::park()`/`thread::unpark()`.
# See: https://github.com/rust-lang/rust/pull/54806#issuecomment-436193353
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
View File
@@ -27,8 +27,8 @@ tokio-threadpool = "0.1.3"
tokio-io = "0.1.6"
[dev-dependencies]
rand = "0.6"
tempfile = ">=3.0.5, <3.1"
rand = "0.7"
tempfile = "~3.1.0"
tokio-io = "0.1.6"
tokio-codec = "0.1.0"
tokio = "0.1.7"
+6
View File
@@ -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)
### Added
+3 -3
View File
@@ -8,13 +8,13 @@ name = "tokio-reactor"
# - README.md
# - Update CHANGELOG.md.
# - Create "v0.1.x" git tag.
version = "0.1.9"
version = "0.1.10"
authors = ["Carl Lerche <[email protected]>"]
license = "MIT"
readme = "README.md"
repository = "https://github.com/tokio-rs/tokio"
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 = """
Event loop that drives Tokio I/O resources.
"""
@@ -27,7 +27,7 @@ lazy_static = "1.0.2"
log = "0.4.1"
mio = "0.6.14"
num_cpus = "1.8.0"
parking_lot = "0.7.0"
parking_lot = "0.9.0"
slab = "0.4.0"
tokio-executor = "0.1.1"
tokio-io = "0.1.6"
+5 -5
View File
@@ -2,7 +2,7 @@
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
@@ -25,10 +25,10 @@ are building a custom I/O resource.
[`mio`]: http://github.com/carllerche/mio
[`futures`]: http://github.com/rust-lang-nursery/futures-rs
[`Reactor`]: https://docs.rs/tokio-reactor/0.1.9/tokio_reactor/struct.Reactor.html
[`Handle`]: https://docs.rs/tokio-reactor/0.1.9/tokio_reactor/struct.Handle.html
[`Registration`]: https://docs.rs/tokio-reactor/0.1.9/tokio_reactor/struct.Registration.html
[`PollEvented`]: https://docs.rs/tokio-reactor/0.1.9/tokio_reactor/struct.PollEvented.html
[`Reactor`]: https://docs.rs/tokio-reactor/0.1.10/tokio_reactor/struct.Reactor.html
[`Handle`]: https://docs.rs/tokio-reactor/0.1.10/tokio_reactor/struct.Handle.html
[`Registration`]: https://docs.rs/tokio-reactor/0.1.10/tokio_reactor/struct.Registration.html
[`PollEvented`]: https://docs.rs/tokio-reactor/0.1.10/tokio_reactor/struct.PollEvented.html
[`tokio`]: ../
## License
+1 -1
View File
@@ -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)]
//! Event loop that drives Tokio I/O resources.
+1 -1
View File
@@ -24,7 +24,7 @@ fnv = "1.0.6"
futures = "0.1.19"
[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-mock-task = "0.1.1"
loom = { version = "0.1.1", features = ["futures"] }
+1 -1
View File
@@ -28,6 +28,6 @@ iovec = "0.1"
futures = "0.1.19"
[dev-dependencies]
env_logger = { version = "0.5", default-features = false }
env_logger = { version = "0.6", default-features = false }
net2 = "0.2"
tokio = "0.1.13"
+8
View File
@@ -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)
### Changed
+5 -4
View File
@@ -8,8 +8,8 @@ name = "tokio-threadpool"
# - README.md
# - Update CHANGELOG.md.
# - Create "v0.1.x" git tag.
version = "0.1.15"
documentation = "https://docs.rs/tokio-threadpool/0.1.14/tokio_threadpool"
version = "0.1.16"
documentation = "https://docs.rs/tokio-threadpool/0.1.16/tokio_threadpool"
repository = "https://github.com/tokio-rs/tokio"
homepage = "https://github.com/tokio-rs/tokio"
license = "MIT"
@@ -27,12 +27,13 @@ crossbeam-deque = "0.7.0"
crossbeam-queue = "0.1.0"
crossbeam-utils = "0.6.4"
num_cpus = "1.2"
rand = "0.6"
slab = "0.4.1"
log = "0.4"
lazy_static = "1"
[dev-dependencies]
env_logger = "0.5"
rand = "0.7"
env_logger = { version = "0.6", default-features = false }
# For comparison benchmarks
futures-cpupool = "0.1.7"
+1 -1
View File
@@ -3,7 +3,7 @@
A library for scheduling execution of futures concurrently across a pool of
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?
+3 -2
View File
@@ -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)]
//! A work-stealing based thread pool for executing futures.
@@ -84,8 +84,9 @@ extern crate crossbeam_queue;
extern crate crossbeam_utils;
#[macro_use]
extern crate futures;
#[macro_use]
extern crate lazy_static;
extern crate num_cpus;
extern crate rand;
extern crate slab;
#[macro_use]
+31 -6
View File
@@ -17,6 +17,8 @@ use worker::{self, Worker, WorkerId};
use futures::Poll;
use std::cell::Cell;
use std::collections::hash_map::RandomState;
use std::hash::{BuildHasher, Hash, Hasher};
use std::num::Wrapping;
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering::{AcqRel, Acquire};
@@ -25,7 +27,6 @@ use std::thread;
use crossbeam_deque::Injector;
use crossbeam_utils::CachePadded;
use rand;
#[derive(Debug)]
pub(crate) struct Pool {
@@ -420,11 +421,7 @@ impl Pool {
/// Uses a thread-local random number generator based on XorShift.
pub fn rand_usize(&self) -> usize {
thread_local! {
static RNG: Cell<Wrapping<u32>> = {
// The initial seed must be non-zero.
let init = rand::random::<u32>() | 1;
Cell::new(Wrapping(init))
}
static RNG: Cell<Wrapping<u32>> = Cell::new(Wrapping(prng_seed()));
}
RNG.with(|rng| {
@@ -448,3 +445,31 @@ impl PartialEq for Pool {
unsafe impl Send 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
}
}
+1 -1
View File
@@ -28,6 +28,6 @@ crossbeam-utils = "0.6.0"
slab = "0.4.1"
[dev-dependencies]
rand = "0.6"
rand = "0.7"
tokio-mock-task = "0.1.0"
tokio = "0.1.7"
+1 -1
View File
@@ -31,7 +31,7 @@ tokio-io = "0.1.7"
[dev-dependencies]
tokio = "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]
openssl = "0.10"
+1 -1
View File
@@ -29,4 +29,4 @@ log = "0.4"
futures = "0.1.19"
[dev-dependencies]
env_logger = { version = "0.5", default-features = false }
env_logger = { version = "0.6", default-features = false }
+1 -1
View File
@@ -33,4 +33,4 @@ tokio-io = "0.1.6"
[dev-dependencies]
tokio = "0.1.6"
tempfile = ">=3.0.5, <3.1"
tempfile = "~3.1.0"
+1 -1
View File
@@ -82,7 +82,7 @@ mio = { version = "0.6.14", optional = true }
tokio-uds = { version = "0.2.1", optional = true }
[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"] }
futures-cpupool = "0.1"
http = "0.1"