From 34dd9d5de02fcfb8820d3605f26abb2c8e9e0753 Mon Sep 17 00:00:00 2001 From: glorv Date: Tue, 30 Aug 2022 14:25:59 +0800 Subject: [PATCH 1/9] limit batch steal size --- crossbeam-deque/src/deque.rs | 172 +++++++++++++++++++++++++++++++++-- 1 file changed, 164 insertions(+), 8 deletions(-) diff --git a/crossbeam-deque/src/deque.rs b/crossbeam-deque/src/deque.rs index bda3bf820..8afe15f4b 100644 --- a/crossbeam-deque/src/deque.rs +++ b/crossbeam-deque/src/deque.rs @@ -693,6 +693,45 @@ impl Stealer { /// assert_eq!(w2.pop(), Some(2)); /// ``` pub fn steal_batch(&self, dest: &Worker) -> Steal<()> { + self.steal_batch_with_limit(dest, MAX_BATCH) + } + + /// Steals no more than `limit` of tasks and pushes them into another worker. + /// + /// How many tasks exactly will be stolen is not specified. That said, this method will try to + /// steal around half of the tasks in the queue, but also not more than the given limit. + /// + /// # Examples + /// + /// ``` + /// use crossbeam_deque::Worker; + /// + /// let w1 = Worker::new_fifo(); + /// w1.push(1); + /// w1.push(2); + /// w1.push(3); + /// w1.push(4); + /// w1.push(5); + /// w1.push(6); + /// + /// let s = w1.stealer(); + /// let w2 = Worker::new_fifo(); + /// + /// let _ = s.steal_batch_with_limit(&w2, 2); + /// assert_eq!(w2.pop(), Some(1)); + /// assert_eq!(w2.pop(), Some(2)); + /// assert_eq!(w2.pop(), None); + /// + /// w1.push(7); + /// w1.push(8); + /// // Setting a large limit does not guarantee that all elements will be popped. In this case, + /// // half of the elements are currently popped, but the number of popped elements is considered + /// // an implementation detail that may be changed in the future. + /// let _ = s.steal_batch_with_limit(&w2, std::usize::MAX); + /// assert_eq!(w2.len(), 3); + /// ``` + pub fn steal_batch_with_limit(&self, dest: &Worker, limit: usize) -> Steal<()> { + assert!(limit > 0); if Arc::ptr_eq(&self.inner, &dest.inner) { if dest.is_empty() { return Steal::Empty; @@ -725,7 +764,7 @@ impl Stealer { } // Reserve capacity for the stolen batch. - let batch_size = cmp::min((len as usize + 1) / 2, MAX_BATCH); + let batch_size = cmp::min((len as usize + 1) / 2, limit); dest.reserve(batch_size); let mut batch_size = batch_size as isize; @@ -891,6 +930,47 @@ impl Stealer { /// assert_eq!(w2.pop(), Some(2)); /// ``` pub fn steal_batch_and_pop(&self, dest: &Worker) -> Steal { + self.steal_batch_with_limit_and_pop(dest, MAX_BATCH) + } + + /// Steals no more than `limit` of tasks, pushes them into another worker, and pops a task from + /// that worker. + /// + /// How many tasks exactly will be stolen is not specified. That said, this method will try to + /// steal around half of the tasks in the queue, but also not more than the given limit. + /// + /// # Examples + /// + /// ``` + /// use crossbeam_deque::{Steal, Worker}; + /// + /// let w1 = Worker::new_fifo(); + /// w1.push(1); + /// w1.push(2); + /// w1.push(3); + /// w1.push(4); + /// w1.push(5); + /// w1.push(6); + /// + /// let s = w1.stealer(); + /// let w2 = Worker::new_fifo(); + /// + /// assert_eq!(s.steal_batch_with_limit_and_pop(&w2, 2), Steal::Success(1)); + /// assert_eq!(w2.pop(), Some(2)); + /// assert_eq!(w2.pop(), None); + /// + /// w1.push(7); + /// w1.push(8); + /// // Setting a large limit does not guarantee that all elements will be popped. In this case, + /// // half of the elements are currently popped, but the number of popped elements is considered + /// // an implementation detail that may be changed in the future. + /// assert_eq!(s.steal_batch_with_limit_and_pop(&w2, std::usize::MAX), Steal::Success(3)); + /// assert_eq!(w2.pop(), Some(4)); + /// assert_eq!(w2.pop(), Some(5)); + /// assert_eq!(w2.pop(), None); + /// ``` + pub fn steal_batch_with_limit_and_pop(&self, dest: &Worker, limit: usize) -> Steal { + assert!(limit > 0); if Arc::ptr_eq(&self.inner, &dest.inner) { match dest.pop() { None => return Steal::Empty, @@ -922,7 +1002,7 @@ impl Stealer { } // Reserve capacity for the stolen batch. - let batch_size = cmp::min((len as usize - 1) / 2, MAX_BATCH - 1); + let batch_size = cmp::min((len as usize - 1) / 2, limit - 1); dest.reserve(batch_size); let mut batch_size = batch_size as isize; @@ -1444,6 +1524,43 @@ impl Injector { /// assert_eq!(w.pop(), Some(2)); /// ``` pub fn steal_batch(&self, dest: &Worker) -> Steal<()> { + self.steal_batch_with_limit(dest, MAX_BATCH) + } + + /// Steals no more than of tasks and pushes them into a worker. + /// + /// How many tasks exactly will be stolen is not specified. That said, this method will try to + /// steal around half of the tasks in the queue, but also not more than some constant limit. + /// + /// # Examples + /// + /// ``` + /// use crossbeam_deque::{Injector, Worker}; + /// + /// let q = Injector::new(); + /// q.push(1); + /// q.push(2); + /// q.push(3); + /// q.push(4); + /// q.push(5); + /// q.push(6); + /// + /// let w = Worker::new_fifo(); + /// let _ = q.steal_batch_with_limit(&w, 2); + /// assert_eq!(w.pop(), Some(1)); + /// assert_eq!(w.pop(), Some(2)); + /// assert_eq!(w.pop(), None); + /// + /// q.push(7); + /// q.push(8); + /// // Setting a large limit does not guarantee that all elements will be popped. In this case, + /// // half of the elements are currently popped, but the number of popped elements is considered + /// // an implementation detail that may be changed in the future. + /// let _ = q.steal_batch_with_limit(&w, std::usize::MAX); + /// assert_eq!(w.len(), 3); + /// ``` + pub fn steal_batch_with_limit(&self, dest: &Worker, limit: usize) -> Steal<()> { + assert!(limit > 0); let mut head; let mut block; let mut offset; @@ -1481,15 +1598,15 @@ impl Injector { if (head >> SHIFT) / LAP != (tail >> SHIFT) / LAP { new_head |= HAS_NEXT; // We can steal all tasks till the end of the block. - advance = (BLOCK_CAP - offset).min(MAX_BATCH); + advance = (BLOCK_CAP - offset).min(limit); } else { let len = (tail - head) >> SHIFT; // Steal half of the available tasks. - advance = ((len + 1) / 2).min(MAX_BATCH); + advance = ((len + 1) / 2).min(limit); } } else { // We can steal all tasks till the end of the block. - advance = (BLOCK_CAP - offset).min(MAX_BATCH); + advance = (BLOCK_CAP - offset).min(limit); } new_head += advance << SHIFT; @@ -1603,6 +1720,45 @@ impl Injector { /// assert_eq!(w.pop(), Some(2)); /// ``` pub fn steal_batch_and_pop(&self, dest: &Worker) -> Steal { + // TODO: we use `MAX_BATCH + 1` as the hard limit for Injecter as the performance is slightly + // better, but we may change it in the future to be compatible with the same method in Stealer. + self.steal_batch_with_limit_and_pop(dest, MAX_BATCH + 1) + } + + /// Steals no more than `limit` of tasks, pushes them into a worker, and pops a task from that worker. + /// + /// How many tasks exactly will be stolen is not specified. That said, this method will try to + /// steal around half of the tasks in the queue, but also not more than the given limit. + /// + /// # Examples + /// + /// ``` + /// use crossbeam_deque::{Injector, Steal, Worker}; + /// + /// let q = Injector::new(); + /// q.push(1); + /// q.push(2); + /// q.push(3); + /// q.push(4); + /// q.push(5); + /// q.push(6); + /// + /// let w = Worker::new_fifo(); + /// assert_eq!(q.steal_batch_with_limit_and_pop(&w, 2), Steal::Success(1)); + /// assert_eq!(w.pop(), Some(2)); + /// assert_eq!(w.pop(), None); + /// + /// q.push(7); + /// // Setting a large limit does not guarantee that all elements will be popped. In this case, + /// // half of the elements are currently popped, but the number of popped elements is considered + /// // an implementation detail that may be changed in the future. + /// assert_eq!(q.steal_batch_with_limit_and_pop(&w, std::usize::MAX), Steal::Success(3)); + /// assert_eq!(w.pop(), Some(4)); + /// assert_eq!(w.pop(), Some(5)); + /// assert_eq!(w.pop(), None); + /// ``` + pub fn steal_batch_with_limit_and_pop(&self, dest: &Worker, limit: usize) -> Steal { + assert!(limit > 0); let mut head; let mut block; let mut offset; @@ -1639,15 +1795,15 @@ impl Injector { if (head >> SHIFT) / LAP != (tail >> SHIFT) / LAP { new_head |= HAS_NEXT; // We can steal all tasks till the end of the block. - advance = (BLOCK_CAP - offset).min(MAX_BATCH + 1); + advance = (BLOCK_CAP - offset).min(limit); } else { let len = (tail - head) >> SHIFT; // Steal half of the available tasks. - advance = ((len + 1) / 2).min(MAX_BATCH + 1); + advance = ((len + 1) / 2).min(limit); } } else { // We can steal all tasks till the end of the block. - advance = (BLOCK_CAP - offset).min(MAX_BATCH + 1); + advance = (BLOCK_CAP - offset).min(limit); } new_head += advance << SHIFT; From b13bdb07a6dbc6a1195923dc2e805b767b679872 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sat, 3 Dec 2022 17:03:30 +0900 Subject: [PATCH 2/9] Fix AtomicCell is_lock_free test on armv7 Fixes #918 --- crossbeam-utils/tests/atomic_cell.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/crossbeam-utils/tests/atomic_cell.rs b/crossbeam-utils/tests/atomic_cell.rs index a1d102210..edb7a4bc0 100644 --- a/crossbeam-utils/tests/atomic_cell.rs +++ b/crossbeam-utils/tests/atomic_cell.rs @@ -35,11 +35,7 @@ fn is_lock_free() { // of `AtomicU64` is `8`, so `AtomicCell` is not lock-free. assert_eq!( AtomicCell::::is_lock_free(), - cfg!(not(crossbeam_no_atomic_64)) - && cfg!(any( - target_pointer_width = "64", - target_pointer_width = "128" - )) + cfg!(not(crossbeam_no_atomic_64)) && std::mem::align_of::() == 8 ); assert_eq!(mem::size_of::(), 8); assert_eq!(mem::align_of::(), 8); From 923d05052684e443ff45f9a5c1339237edce99f2 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Wed, 18 Jan 2023 23:32:57 +0900 Subject: [PATCH 3/9] Wait forever on very large timeout --- crossbeam-channel/src/channel.rs | 28 ++++++++++++++++++++------- crossbeam-channel/src/flavors/at.rs | 7 +------ crossbeam-channel/src/flavors/tick.rs | 5 ++--- crossbeam-channel/src/select.rs | 10 ++++++++-- crossbeam-channel/src/utils.rs | 8 -------- crossbeam-utils/src/sync/parker.rs | 5 ++++- 6 files changed, 36 insertions(+), 27 deletions(-) diff --git a/crossbeam-channel/src/channel.rs b/crossbeam-channel/src/channel.rs index 7871bcb70..bd241156f 100644 --- a/crossbeam-channel/src/channel.rs +++ b/crossbeam-channel/src/channel.rs @@ -14,7 +14,6 @@ use crate::err::{ }; use crate::flavors; use crate::select::{Operation, SelectHandle, Token}; -use crate::utils; /// Creates a channel of unbounded capacity. /// @@ -172,8 +171,11 @@ pub fn bounded(cap: usize) -> (Sender, Receiver) { /// assert!(eq(Instant::now(), start + ms(500))); /// ``` pub fn after(duration: Duration) -> Receiver { - Receiver { - flavor: ReceiverFlavor::At(Arc::new(flavors::at::Channel::new_timeout(duration))), + match Instant::now().checked_add(duration) { + Some(deadline) => Receiver { + flavor: ReceiverFlavor::At(Arc::new(flavors::at::Channel::new_deadline(deadline))), + }, + None => never(), } } @@ -320,8 +322,14 @@ pub fn never() -> Receiver { /// assert!(eq(Instant::now(), start + ms(700))); /// ``` pub fn tick(duration: Duration) -> Receiver { - Receiver { - flavor: ReceiverFlavor::Tick(Arc::new(flavors::tick::Channel::new(duration))), + match Instant::now().checked_add(duration) { + Some(delivery_time) => Receiver { + flavor: ReceiverFlavor::Tick(Arc::new(flavors::tick::Channel::new( + delivery_time, + duration, + ))), + }, + None => never(), } } @@ -474,7 +482,10 @@ impl Sender { /// ); /// ``` pub fn send_timeout(&self, msg: T, timeout: Duration) -> Result<(), SendTimeoutError> { - self.send_deadline(msg, utils::convert_timeout_to_deadline(timeout)) + match Instant::now().checked_add(timeout) { + Some(deadline) => self.send_deadline(msg, deadline), + None => self.send(msg).map_err(SendTimeoutError::from), + } } /// Waits for a message to be sent into the channel, but only until a given deadline. @@ -864,7 +875,10 @@ impl Receiver { /// ); /// ``` pub fn recv_timeout(&self, timeout: Duration) -> Result { - self.recv_deadline(utils::convert_timeout_to_deadline(timeout)) + match Instant::now().checked_add(timeout) { + Some(deadline) => self.recv_deadline(deadline), + None => self.recv().map_err(RecvTimeoutError::from), + } } /// Waits for a message to be received from the channel, but only before a given deadline. diff --git a/crossbeam-channel/src/flavors/at.rs b/crossbeam-channel/src/flavors/at.rs index ca5ee60f5..515c4e33b 100644 --- a/crossbeam-channel/src/flavors/at.rs +++ b/crossbeam-channel/src/flavors/at.rs @@ -4,7 +4,7 @@ use std::sync::atomic::{AtomicBool, Ordering}; use std::thread; -use std::time::{Duration, Instant}; +use std::time::Instant; use crate::context::Context; use crate::err::{RecvTimeoutError, TryRecvError}; @@ -32,11 +32,6 @@ impl Channel { received: AtomicBool::new(false), } } - /// Creates a channel that delivers a message after a certain duration of time. - #[inline] - pub(crate) fn new_timeout(dur: Duration) -> Self { - Self::new_deadline(utils::convert_timeout_to_deadline(dur)) - } /// Attempts to receive a message without blocking. #[inline] diff --git a/crossbeam-channel/src/flavors/tick.rs b/crossbeam-channel/src/flavors/tick.rs index 4201b6eb0..d38f6a594 100644 --- a/crossbeam-channel/src/flavors/tick.rs +++ b/crossbeam-channel/src/flavors/tick.rs @@ -10,7 +10,6 @@ use crossbeam_utils::atomic::AtomicCell; use crate::context::Context; use crate::err::{RecvTimeoutError, TryRecvError}; use crate::select::{Operation, SelectHandle, Token}; -use crate::utils; /// Result of a receive operation. pub(crate) type TickToken = Option; @@ -27,9 +26,9 @@ pub(crate) struct Channel { impl Channel { /// Creates a channel that delivers messages periodically. #[inline] - pub(crate) fn new(dur: Duration) -> Self { + pub(crate) fn new(delivery_time: Instant, dur: Duration) -> Self { Channel { - delivery_time: AtomicCell::new(utils::convert_timeout_to_deadline(dur)), + delivery_time: AtomicCell::new(delivery_time), duration: dur, } } diff --git a/crossbeam-channel/src/select.rs b/crossbeam-channel/src/select.rs index 57d67a3a1..3eb0b97c8 100644 --- a/crossbeam-channel/src/select.rs +++ b/crossbeam-channel/src/select.rs @@ -487,7 +487,10 @@ pub fn select_timeout<'a>( handles: &mut [(&'a dyn SelectHandle, usize, *const u8)], timeout: Duration, ) -> Result, SelectTimeoutError> { - select_deadline(handles, utils::convert_timeout_to_deadline(timeout)) + match Instant::now().checked_add(timeout) { + Some(deadline) => select_deadline(handles, deadline), + None => Ok(select(handles)), + } } /// Blocks until a given deadline, or until one of the operations becomes ready and selects it. @@ -1045,7 +1048,10 @@ impl<'a> Select<'a> { /// } /// ``` pub fn ready_timeout(&mut self, timeout: Duration) -> Result { - self.ready_deadline(utils::convert_timeout_to_deadline(timeout)) + match Instant::now().checked_add(timeout) { + Some(deadline) => self.ready_deadline(deadline), + None => Ok(self.ready()), + } } /// Blocks until a given deadline, or until one of the operations becomes ready. diff --git a/crossbeam-channel/src/utils.rs b/crossbeam-channel/src/utils.rs index 9f14c8e65..f623f2708 100644 --- a/crossbeam-channel/src/utils.rs +++ b/crossbeam-channel/src/utils.rs @@ -56,11 +56,3 @@ pub(crate) fn sleep_until(deadline: Option) { } } } - -// https://github.com/crossbeam-rs/crossbeam/issues/795 -pub(crate) fn convert_timeout_to_deadline(timeout: Duration) -> Instant { - match Instant::now().checked_add(timeout) { - Some(deadline) => deadline, - None => Instant::now() + Duration::from_secs(86400 * 365 * 30), - } -} diff --git a/crossbeam-utils/src/sync/parker.rs b/crossbeam-utils/src/sync/parker.rs index e791c4485..9cb3a2601 100644 --- a/crossbeam-utils/src/sync/parker.rs +++ b/crossbeam-utils/src/sync/parker.rs @@ -122,7 +122,10 @@ impl Parker { /// p.park_timeout(Duration::from_millis(500)); /// ``` pub fn park_timeout(&self, timeout: Duration) { - self.park_deadline(Instant::now() + timeout) + match Instant::now().checked_add(timeout) { + Some(deadline) => self.park_deadline(deadline), + None => self.park(), + } } /// Blocks the current thread until the token is made available, or until a certain deadline. From 7df683c8ce23ecea87f2e2cd1f84b7fa357a9dd0 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Thu, 19 Jan 2023 00:02:05 +0900 Subject: [PATCH 4/9] Make `scope()` function soft-deprecated Make crossbeam's `scope()` function soft-deprecated in favor of the more efficient `std::thread::scope` that stabilized on Rust 1.63. --- crossbeam-utils/src/thread.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crossbeam-utils/src/thread.rs b/crossbeam-utils/src/thread.rs index f1086d9ec..74464544a 100644 --- a/crossbeam-utils/src/thread.rs +++ b/crossbeam-utils/src/thread.rs @@ -133,6 +133,8 @@ type SharedOption = Arc>>; /// returned containing errors from panicked threads. Note that if panics are implemented by /// aborting the process, no error is returned; see the notes of [std::panic::catch_unwind]. /// +/// **Note:** Since Rust 1.63, this function is soft-deprecated in favor of the more efficient [`std::thread::scope`]. +/// /// # Examples /// /// ``` From 78a4331f60653d5622ec9ec5660dd03f830a5549 Mon Sep 17 00:00:00 2001 From: "Alexis (Poliorcetics) Bourget" Date: Mon, 23 Jan 2023 16:22:57 +0100 Subject: [PATCH 5/9] Deps: update to memoffset 0.8 --- crossbeam-epoch/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crossbeam-epoch/Cargo.toml b/crossbeam-epoch/Cargo.toml index e8ee17e3c..e079a64ec 100644 --- a/crossbeam-epoch/Cargo.toml +++ b/crossbeam-epoch/Cargo.toml @@ -47,7 +47,7 @@ autocfg = "1" [dependencies] cfg-if = "1" -memoffset = "0.7" +memoffset = "0.8" scopeguard = { version = "1.1", default-features = false } # Enable the use of loom for concurrency testing. From 6871c0025a5841550cc83549b6f7f30c8ecaa7f6 Mon Sep 17 00:00:00 2001 From: Caio Date: Thu, 2 Feb 2023 11:22:18 -0300 Subject: [PATCH 6/9] Mark some structures with `#[clippy::has_significant_drop]` `#[clippy::has_significant_drop]` tells that a structure should be considered when evaluating some lints. Examples of such behavior are the existent `clippy::significant_drop_in_scrutinee` and in the soon-to-be-finished https://github.com/rust-lang/rust-clippy/issues/9399. --- crossbeam-utils/src/sync/sharded_lock.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crossbeam-utils/src/sync/sharded_lock.rs b/crossbeam-utils/src/sync/sharded_lock.rs index b43c55ea4..a8f4584e3 100644 --- a/crossbeam-utils/src/sync/sharded_lock.rs +++ b/crossbeam-utils/src/sync/sharded_lock.rs @@ -480,6 +480,7 @@ impl From for ShardedLock { } /// A guard used to release the shared read access of a [`ShardedLock`] when dropped. +#[clippy::has_significant_drop] pub struct ShardedLockReadGuard<'a, T: ?Sized> { lock: &'a ShardedLock, _guard: RwLockReadGuard<'a, ()>, @@ -511,6 +512,7 @@ impl fmt::Display for ShardedLockReadGuard<'_, T> { } /// A guard used to release the exclusive write access of a [`ShardedLock`] when dropped. +#[clippy::has_significant_drop] pub struct ShardedLockWriteGuard<'a, T: ?Sized> { lock: &'a ShardedLock, _marker: PhantomData>, From 56397a1d3d86b1eeb2a0bfb56dabf48362c1aaff Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Tue, 28 Feb 2023 22:32:48 +0900 Subject: [PATCH 7/9] Handle min-atomic-width in no_atomic.sh --- ci/no_atomic.sh | 5 +++++ no_atomic.rs | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ci/no_atomic.sh b/ci/no_atomic.sh index 232140f63..186b8bcce 100755 --- a/ci/no_atomic.sh +++ b/ci/no_atomic.sh @@ -18,6 +18,7 @@ for target in $(rustc --print target-list); do res=$(jq <<<"${target_spec}" -r 'select(."atomic-cas" == false)') [[ -z "${res}" ]] || no_atomic_cas+=("${target}") max_atomic_width=$(jq <<<"${target_spec}" -r '."max-atomic-width"') + min_atomic_width=$(jq <<<"${target_spec}" -r '."min-atomic-width"') case "${max_atomic_width}" in # It is not clear exactly what `"max-atomic-width" == null` means, but they # actually seem to have the same max-atomic-width as the target-pointer-width. @@ -35,6 +36,10 @@ for target in $(rustc --print target-list); do # There is no `"max-atomic-width" == 16` or `"max-atomic-width" == 8` targets. *) exit 1 ;; esac + case "${min_atomic_width}" in + 8 | null) ;; + *) no_atomic+=("${target}") ;; + esac done cat >"${file}" < Date: Tue, 28 Feb 2023 22:53:05 +0900 Subject: [PATCH 8/9] Use cargo-no-dev-deps to workaround cargo bug --- .github/workflows/ci.yml | 2 ++ ci/check-features.sh | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 08325e745..2624a7910 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,6 +85,8 @@ jobs: toolchain: ${{ matrix.rust }} - name: Install cargo-hack uses: taiki-e/install-action@cargo-hack + - name: Install cargo-no-dev-deps + uses: taiki-e/install-action@cargo-no-dev-deps - name: Check features run: ./ci/check-features.sh diff --git a/ci/check-features.sh b/ci/check-features.sh index 6c4a02978..9c91862a6 100755 --- a/ci/check-features.sh +++ b/ci/check-features.sh @@ -6,13 +6,13 @@ cd "$(dirname "$0")"/.. if [[ "$RUST_VERSION" != "nightly"* ]]; then # On MSRV, features other than nightly should work. # * `--feature-powerset` - run for the feature powerset which includes --no-default-features and default features of package - # * `--no-dev-deps` - build without dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866 - # * `--exclude benchmarks` - benchmarks doesn't published. + # * `no-dev-deps` - build without dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866 + # * `--no-private` - exclude private crate such as benchmarks. # * `--skip nightly` - skip `nightly` feature as requires nightly compilers. - cargo hack build --all --feature-powerset --no-dev-deps --exclude benchmarks --skip nightly + cargo no-dev-deps hack build --all --feature-powerset --no-private --skip nightly else # On nightly, all feature combinations should work. - cargo hack build --all --feature-powerset --no-dev-deps --exclude benchmarks + cargo no-dev-deps hack build --all --feature-powerset --no-private # Build for no_std environment. # thumbv7m-none-eabi supports atomic CAS. @@ -21,7 +21,7 @@ else rustup target add thumbv7m-none-eabi rustup target add thumbv6m-none-eabi rustup target add riscv32i-unknown-none-elf - cargo hack build --all --feature-powerset --no-dev-deps --exclude benchmarks --target thumbv7m-none-eabi --skip std,default - cargo hack build --all --feature-powerset --no-dev-deps --exclude benchmarks --target thumbv6m-none-eabi --skip std,default - cargo hack build --all --feature-powerset --no-dev-deps --exclude benchmarks --target riscv32i-unknown-none-elf --skip std,default + cargo no-dev-deps hack build --all --feature-powerset --no-private --target thumbv7m-none-eabi --skip std,default + cargo no-dev-deps hack build --all --feature-powerset --no-private --target thumbv6m-none-eabi --skip std,default + cargo no-dev-deps hack build --all --feature-powerset --no-private --target riscv32i-unknown-none-elf --skip std,default fi From 9b2b386c63e210ed3b196fe1e46fd91a6c9e50bf Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Tue, 28 Feb 2023 22:53:14 +0900 Subject: [PATCH 9/9] Prepare for the next release - crossbeam-channel 0.5.6 -> 0.5.7 - crossbeam-deque 0.8.2 -> 0.8.3 - crossbeam-epoch 0.9.13 -> 0.9.14 - crossbeam-utils 0.8.14 -> 0.8.15 --- crossbeam-channel/CHANGELOG.md | 4 ++++ crossbeam-channel/Cargo.toml | 2 +- crossbeam-deque/CHANGELOG.md | 5 +++++ crossbeam-deque/Cargo.toml | 2 +- crossbeam-epoch/CHANGELOG.md | 4 ++++ crossbeam-epoch/Cargo.toml | 2 +- crossbeam-utils/CHANGELOG.md | 6 ++++++ crossbeam-utils/Cargo.toml | 2 +- 8 files changed, 23 insertions(+), 4 deletions(-) diff --git a/crossbeam-channel/CHANGELOG.md b/crossbeam-channel/CHANGELOG.md index f0d11e60c..3277f15aa 100644 --- a/crossbeam-channel/CHANGELOG.md +++ b/crossbeam-channel/CHANGELOG.md @@ -1,3 +1,7 @@ +# Version 0.5.7 + +- Improve handling of very large timeout. (#953) + # Version 0.5.6 - Bump the minimum supported Rust version to 1.38. (#877) diff --git a/crossbeam-channel/Cargo.toml b/crossbeam-channel/Cargo.toml index 808920227..25c367802 100644 --- a/crossbeam-channel/Cargo.toml +++ b/crossbeam-channel/Cargo.toml @@ -4,7 +4,7 @@ name = "crossbeam-channel" # - Update CHANGELOG.md # - Update README.md # - Create "crossbeam-channel-X.Y.Z" git tag -version = "0.5.6" +version = "0.5.7" edition = "2018" rust-version = "1.38" license = "MIT OR Apache-2.0" diff --git a/crossbeam-deque/CHANGELOG.md b/crossbeam-deque/CHANGELOG.md index 855b714f4..0937d192f 100644 --- a/crossbeam-deque/CHANGELOG.md +++ b/crossbeam-deque/CHANGELOG.md @@ -1,3 +1,8 @@ +# Version 0.8.3 + +- Add `Stealer::{steal_batch_with_limit, steal_batch_with_limit_and_pop}` methods. (#903) +- Add `Injector::{steal_batch_with_limit, steal_batch_with_limit_and_pop}` methods. (#903) + # Version 0.8.2 - Bump the minimum supported Rust version to 1.38. (#877) diff --git a/crossbeam-deque/Cargo.toml b/crossbeam-deque/Cargo.toml index f8199e79a..805a7e005 100644 --- a/crossbeam-deque/Cargo.toml +++ b/crossbeam-deque/Cargo.toml @@ -4,7 +4,7 @@ name = "crossbeam-deque" # - Update CHANGELOG.md # - Update README.md # - Create "crossbeam-deque-X.Y.Z" git tag -version = "0.8.2" +version = "0.8.3" edition = "2018" rust-version = "1.38" license = "MIT OR Apache-2.0" diff --git a/crossbeam-epoch/CHANGELOG.md b/crossbeam-epoch/CHANGELOG.md index 9de9146e2..f7508aea7 100644 --- a/crossbeam-epoch/CHANGELOG.md +++ b/crossbeam-epoch/CHANGELOG.md @@ -1,3 +1,7 @@ +# Version 0.9.14 + +- Update `memoffset` to 0.8. (#955) + # Version 0.9.13 - Fix build script bug introduced in 0.9.12. (#932) diff --git a/crossbeam-epoch/Cargo.toml b/crossbeam-epoch/Cargo.toml index e079a64ec..45428bf40 100644 --- a/crossbeam-epoch/Cargo.toml +++ b/crossbeam-epoch/Cargo.toml @@ -4,7 +4,7 @@ name = "crossbeam-epoch" # - Update CHANGELOG.md # - Update README.md # - Create "crossbeam-epoch-X.Y.Z" git tag -version = "0.9.13" +version = "0.9.14" edition = "2018" rust-version = "1.38" license = "MIT OR Apache-2.0" diff --git a/crossbeam-utils/CHANGELOG.md b/crossbeam-utils/CHANGELOG.md index 8e0fe35b9..994b6c34e 100644 --- a/crossbeam-utils/CHANGELOG.md +++ b/crossbeam-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +# Version 0.8.15 + +- Add `#[clippy::has_significant_drop]` to `ShardedLock{Read,Write}Guard`. (#958) +- Improve handling of very large timeout. (#953) +- Soft-deprecate `thread::scope()` in favor of the more efficient `std::thread::scope` that stabilized on Rust 1.63. (#954) + # Version 0.8.14 - Fix build script bug introduced in 0.8.13. (#932) diff --git a/crossbeam-utils/Cargo.toml b/crossbeam-utils/Cargo.toml index 1674775fe..155fcc131 100644 --- a/crossbeam-utils/Cargo.toml +++ b/crossbeam-utils/Cargo.toml @@ -4,7 +4,7 @@ name = "crossbeam-utils" # - Update CHANGELOG.md # - Update README.md # - Create "crossbeam-utils-X.Y.Z" git tag -version = "0.8.14" +version = "0.8.15" edition = "2018" rust-version = "1.38" license = "MIT OR Apache-2.0"