From b2653794a0830bfa983d9fb295c79413ff9927bb Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 3 Jun 2020 13:23:49 +0200 Subject: [PATCH 01/17] add coverage workflow --- .github/workflows/coverage.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..7684837 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,23 @@ +name: coverage + +on: [ "push" , "pull_request" ] +jobs: + test: + name: coverage + runs-on: ubuntu-latest + container: + image: xd009642/tarpaulin + options: --security-opt seccomp=unconfined + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Generate code coverage + run: | + cargo build && \ + cargo tarpaulin --verbose --all-features --workspace --timeout 600 --out Lcov --output-dir coverage + + - name: Upload to coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} From aa9690050a2575115a7e18178bb76c8d2b02f8e1 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 3 Jun 2020 14:01:07 +0200 Subject: [PATCH 02/17] add code coverage via cargo tarpaulin and coveralls --- .github/workflows/coverage.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 7684837..f4b77d5 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -14,8 +14,7 @@ jobs: - name: Generate code coverage run: | - cargo build && \ - cargo tarpaulin --verbose --all-features --workspace --timeout 600 --out Lcov --output-dir coverage + cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out Lcov --output-dir coverage - name: Upload to coveralls uses: coverallsapp/github-action@master From 00d6c86637133e941c4a092b561f2f84d24b6b00 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 3 Jun 2020 14:11:36 +0200 Subject: [PATCH 03/17] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index f044844..4b78135 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +[![Rust](https://github.com/haraldh/dynqueue/workflows/Rust/badge.svg)](https://github.com/haraldh/dynqueue/actions) +[![Coverage Status](https://coveralls.io/repos/github/haraldh/dynqueue/badge.svg?branch=master)](https://coveralls.io/github/haraldh/dynqueue?branch=master) + # DynQueue - dynamically extendable Rayon parallel iterator A `DynQueue` can be iterated with `into_par_iter` producing `(DynQueueHandle, T)` elements. From 84d72fc0f89d581ad831d7c650e896f0f226a2e7 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 22 Jun 2020 12:02:17 +0200 Subject: [PATCH 04/17] impl Queue for crossbeam_queue::SegQueue Resolves: https://github.com/haraldh/dynqueue/issues/2 --- Cargo.toml | 3 ++- README.md | 5 +++++ src/lib.rs | 36 +++++++++++++++++++++++++++++++++++- src/tests.rs | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 75 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c2da882..f9fa38e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dynqueue" -version = "0.1.2" +version = "0.1.3" authors = ["Harald Hoyer "] edition = "2018" @@ -16,3 +16,4 @@ categories = [ "concurrency" ] [dependencies] rayon = "1.3.0" +crossbeam-queue = { version = "0.2", optional = true } diff --git a/README.md b/README.md index 4b78135..f12d753 100644 --- a/README.md +++ b/README.md @@ -23,3 +23,8 @@ fn main() { assert_eq!(result, vec![1, 2, 3, 4]); } ``` + +## Features + +* `crossbeam-queue` : to use `crossbeam::queue::SegQueue` as the inner collection. + diff --git a/src/lib.rs b/src/lib.rs index c59b075..ae8a1bc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -119,6 +119,36 @@ impl Queue for VecDeque { } } +#[cfg(feature = "crossbeam-queue")] +use crossbeam_queue::SegQueue; + +#[cfg(feature = "crossbeam-queue")] +impl Queue for SegQueue { + #[inline(always)] + fn push(&mut self, v: T) { + SegQueue::push(self, v); + } + + #[inline(always)] + fn pop(&mut self) -> Option { + SegQueue::pop(self).ok() + } + + #[inline(always)] + fn len(&self) -> usize { + SegQueue::len(self) + } + + #[inline(always)] + fn split_off(&mut self, size: usize) -> Self { + let q = SegQueue::new(); + (0..size) + .filter_map(|_| self.pop()) + .for_each(|ele| q.push(ele)); + q + } +} + // PhantomData should prevent `DynQueueInner` to outlive the original `DynQueue` // but does not always. struct DynQueueInner<'a, T, U: Queue>(std::sync::RwLock, PhantomData<&'a T>); @@ -137,7 +167,11 @@ impl<'a, T, U: Queue> DynQueueHandle<'a, T, U> { /// The `DynQueue` which can be parallel iterated over pub struct DynQueue<'a, T, U: Queue>(Arc>); -impl<'a, T, U: Queue> DynQueue<'a, T, U> { +impl<'a, T, U: Queue> DynQueue<'a, T, U> +where + T: Send + Sync, + U: Queue + Send + Sync, +{ /// Create a new `DynQueue` from a `Vec` #[inline] pub fn new(lifo: U) -> Self { diff --git a/src/tests.rs b/src/tests.rs index 05be6ce..f9f8a49 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -69,6 +69,39 @@ fn dynqueue_iter_test_const_sleep() { ); } +#[cfg(feature = "crossbeam-queue")] +#[test] +fn dynqueue_iter_test_const_sleep_segqueue() { + use crossbeam_queue::SegQueue; + use rayon::iter::IntoParallelIterator as _; + use rayon::iter::ParallelIterator as _; + use std::time::Duration; + let expected = get_expected(); + + let med = expected.iter().sum::() / expected.iter().count() as u64; + let q = SegQueue::new(); + get_input().drain(..).for_each(|ele| q.push(ele)); + + let jq = DynQueue::new(q); + let now = std::time::Instant::now(); + + let mut res = jq + .into_par_iter() + .map(handle_queue) + .map(|v| { + std::thread::sleep(Duration::from_millis(SLEEP_MS * med)); + v + }) + .collect::>(); + eprintln!("elapsed = {:#?}", now.elapsed()); + res.sort(); + assert_eq!(res, expected); + eprintln!( + "instead of = {}ms", + res.iter().count() * med as usize * SLEEP_MS as usize + ); +} + #[test] fn dynqueue_iter_test_const_sleep_vecdeque() { use rayon::iter::IntoParallelIterator as _; From 8a147b3ecb2c627aa178c1958274ad8a32aca516 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 22 Jun 2020 12:08:31 +0200 Subject: [PATCH 05/17] (cargo-release) start next development iteration 0.1.4-alpha.0 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index f9fa38e..6fde620 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dynqueue" -version = "0.1.3" +version = "0.1.4-alpha.0" authors = ["Harald Hoyer "] edition = "2018" From 73a68a8cd35d7640844c6f437b09a11d56af83b3 Mon Sep 17 00:00:00 2001 From: Atul Bhosale Date: Wed, 24 Jun 2020 23:50:49 +0530 Subject: [PATCH 06/17] Add cargo fmt to github actions --- .github/workflows/rust.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6738b0b..a9d44c6 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -13,6 +13,8 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Run fmt + run: cargo fmt --all -- --check - name: Build run: cargo build --verbose - name: Run tests From e157e17d7a46e5195b2fbc2ea8ed60fa837ff38b Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 20 Jul 2020 13:46:14 +0200 Subject: [PATCH 07/17] Change lib to handle lockless collections crossbeam_queue::SegQueue does not need a guarding RwLock. Fixes: https://github.com/haraldh/dynqueue/issues/4 --- Cargo.toml | 2 +- README.md | 16 +++-- src/lib.rs | 174 ++++++++++++++++++++++++++++++++------------------- src/tests.rs | 19 +++--- 4 files changed, 132 insertions(+), 79 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6fde620..5bbc133 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,5 +15,5 @@ keywords = [ "parallel", "performance", "thread", "join", "concurrency"] categories = [ "concurrency" ] [dependencies] -rayon = "1.3.0" +rayon = "1.3" crossbeam-queue = { version = "0.2", optional = true } diff --git a/README.md b/README.md index f12d753..931896a 100644 --- a/README.md +++ b/README.md @@ -7,17 +7,21 @@ A `DynQueue` can be iterated with `into_par_iter` producing `(DynQueueHandle, With the `DynQueueHandle` a new `T` can be inserted in the `DynQueue`, which is currently iterated over. -```rust -use dynqueue::DynQueue; +A `Vec`, `VecDeque` and `crossbeam_queue::SegQueue` (with `feature = "crossbeam-queue"`) +can be turned into a `DynQueue` with `.into_dyn_queue()`. +```rust use rayon::iter::IntoParallelIterator as _; use rayon::iter::ParallelIterator as _; +use dynqueue::IntoDynQueue as _; + fn main() { - let mut result = DynQueue::new(vec![1, 2, 3]) - .into_par_iter() - .map(|(handle, value)| { if value == 2 { handle.enqueue(4) }; value }) - .collect::>(); + let mut result = vec![1, 2, 3] + .into_dyn_queue() + .into_par_iter() + .map(|(handle, value)| { if value == 2 { handle.enqueue(4) }; value }) + .collect::>(); result.sort(); assert_eq!(result, vec![1, 2, 3, 4]); diff --git a/src/lib.rs b/src/lib.rs index ae8a1bc..e822ae0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,15 +7,21 @@ //! # Example //! //! ``` -//! use dynqueue::{DynQueue, DynQueueHandle}; -//! //! use rayon::iter::IntoParallelIterator as _; //! use rayon::iter::ParallelIterator as _; //! -//! let mut result = DynQueue::new(vec![1, 2, 3]) -//! .into_par_iter() -//! .map(|(handle, value)| { if value == 2 { handle.enqueue(4) }; value }) -//! .collect::>(); +//! use dynqueue::IntoDynQueue as _; +//! +//! let mut result = vec![1, 2, 3] +//! .into_dyn_queue() +//! .into_par_iter() +//! .map(|(handle, value)| { +//! if value == 2 { +//! handle.enqueue(4) +//! }; +//! value +//! }) +//! .collect::>(); //! result.sort(); //! //! assert_eq!(result, vec![1, 2, 3, 4]); @@ -26,27 +32,45 @@ //! The `DynQueueHandle` shall not outlive the `DynQueue` iterator //! //! ```should_panic -//! use dynqueue::{DynQueue, DynQueueHandle}; +//! use dynqueue::{DynQueue, DynQueueHandle, IntoDynQueue}; //! //! use rayon::iter::IntoParallelIterator as _; //! use rayon::iter::ParallelIterator as _; +//! use std::sync::RwLock; //! -//! static mut STALE_HANDLE : Option>> = None; +//! static mut STALE_HANDLE: Option>>> = None; //! //! pub fn test_func() -> Vec { -//! DynQueue::new(vec![1u8, 2u8, 3u8]) +//! vec![1u8, 2u8, 3u8] +//! .into_dyn_queue() //! .into_par_iter() -//! .map(|(handle, value)| unsafe { STALE_HANDLE.replace(handle); value }) +//! .map(|(handle, value)| unsafe { +//! STALE_HANDLE.replace(handle); +//! value +//! }) //! .collect::>() //! } //! // test_func() panics //! let result = test_func(); -//! unsafe { STALE_HANDLE.as_ref().unwrap().enqueue(4); } +//! unsafe { +//! STALE_HANDLE.as_ref().unwrap().enqueue(4); +//! } //! ``` #![deny(clippy::all)] #![deny(missing_docs)] +#[allow(unused)] +macro_rules! doc_comment { + ($x:expr) => { + #[doc = $x] + #[doc(hidden)] + mod readme_tests {} + }; +} + +doc_comment!(include_str!("../README.md")); + use rayon::iter::plumbing::{ bridge_unindexed, Consumer, Folder, UnindexedConsumer, UnindexedProducer, }; @@ -57,80 +81,123 @@ use std::sync::{Arc, RwLock}; #[cfg(test)] mod tests; +/// Trait to produce a new DynQueue +pub trait IntoDynQueue> { + /// new + fn into_dyn_queue<'a>(self) -> DynQueue<'a, T, U>; +} + /// Everything implementing `Queue` can be handled by DynQueue +#[allow(clippy::len_without_is_empty)] pub trait Queue where Self: Sized, { /// push an element in the queue - fn push(&mut self, v: T); + fn push(&self, v: T); /// pop an element from the queue - fn pop(&mut self) -> Option; + fn pop(&self) -> Option; /// number of elements in the queue fn len(&self) -> usize; /// split off `size` elements - fn split_off(&mut self, size: usize) -> Self; + fn split_off(&self, size: usize) -> Self; } -impl Queue for Vec { +impl IntoDynQueue>> for Vec { #[inline(always)] - fn push(&mut self, v: T) { - Vec::push(self, v) + fn into_dyn_queue<'a>(self) -> DynQueue<'a, T, RwLock>> { + DynQueue(Arc::new(DynQueueInner(RwLock::new(self), PhantomData))) + } +} + +impl IntoDynQueue>> for RwLock> { + #[inline(always)] + fn into_dyn_queue<'a>(self) -> DynQueue<'a, T, RwLock>> { + DynQueue(Arc::new(DynQueueInner(self, PhantomData))) + } +} + +impl Queue for RwLock> { + #[inline(always)] + fn push(&self, v: T) { + self.write().unwrap().push(v) } #[inline(always)] - fn pop(&mut self) -> Option { - Vec::pop(self) + fn pop(&self) -> Option { + self.write().unwrap().pop() } #[inline(always)] fn len(&self) -> usize { - Vec::len(self) + self.read().unwrap().len() } #[inline(always)] - fn split_off(&mut self, size: usize) -> Self { - Vec::split_off(self, size) + fn split_off(&self, size: usize) -> Self { + RwLock::new(self.write().unwrap().split_off(size)) } } -impl Queue for VecDeque { +impl IntoDynQueue>> for VecDeque { #[inline(always)] - fn push(&mut self, v: T) { - VecDeque::push_back(self, v) + fn into_dyn_queue<'a>(self) -> DynQueue<'a, T, RwLock>> { + DynQueue(Arc::new(DynQueueInner(RwLock::new(self), PhantomData))) + } +} + +impl IntoDynQueue>> for RwLock> { + #[inline(always)] + fn into_dyn_queue<'a>(self) -> DynQueue<'a, T, RwLock>> { + DynQueue(Arc::new(DynQueueInner(self, PhantomData))) + } +} + +impl Queue for RwLock> { + #[inline(always)] + fn push(&self, v: T) { + self.write().unwrap().push_back(v) } #[inline(always)] - fn pop(&mut self) -> Option { - VecDeque::pop_front(self) + fn pop(&self) -> Option { + self.write().unwrap().pop_front() } #[inline(always)] fn len(&self) -> usize { - VecDeque::len(self) + self.read().unwrap().len() } #[inline(always)] - fn split_off(&mut self, size: usize) -> Self { - VecDeque::split_off(self, size) + fn split_off(&self, size: usize) -> Self { + RwLock::new(self.write().unwrap().split_off(size)) } } #[cfg(feature = "crossbeam-queue")] use crossbeam_queue::SegQueue; +#[cfg(feature = "crossbeam-queue")] +impl IntoDynQueue> for SegQueue { + #[inline(always)] + fn into_dyn_queue<'a>(self) -> DynQueue<'a, T, Self> { + DynQueue(Arc::new(DynQueueInner(self, PhantomData))) + } +} + #[cfg(feature = "crossbeam-queue")] impl Queue for SegQueue { #[inline(always)] - fn push(&mut self, v: T) { + fn push(&self, v: T) { SegQueue::push(self, v); } #[inline(always)] - fn pop(&mut self) -> Option { + fn pop(&self) -> Option { SegQueue::pop(self).ok() } @@ -140,10 +207,10 @@ impl Queue for SegQueue { } #[inline(always)] - fn split_off(&mut self, size: usize) -> Self { + fn split_off(&self, size: usize) -> Self { let q = SegQueue::new(); (0..size) - .filter_map(|_| self.pop()) + .filter_map(|_| Queue::pop(self)) .for_each(|ele| q.push(ele)); q } @@ -151,7 +218,7 @@ impl Queue for SegQueue { // PhantomData should prevent `DynQueueInner` to outlive the original `DynQueue` // but does not always. -struct DynQueueInner<'a, T, U: Queue>(std::sync::RwLock, PhantomData<&'a T>); +struct DynQueueInner<'a, T, U: Queue>(U, PhantomData<&'a T>); /// The `DynQueueHandle` returned by the iterator in addition to `T` pub struct DynQueueHandle<'a, T, U: Queue>(Arc>); @@ -160,44 +227,26 @@ impl<'a, T, U: Queue> DynQueueHandle<'a, T, U> { /// Enqueue `T` in the `DynQueue`, which is currently iterated. #[inline] pub fn enqueue(&self, job: T) { - (self.0).0.write().unwrap().push(job) + (self.0).0.push(job) } } /// The `DynQueue` which can be parallel iterated over pub struct DynQueue<'a, T, U: Queue>(Arc>); -impl<'a, T, U: Queue> DynQueue<'a, T, U> -where - T: Send + Sync, - U: Queue + Send + Sync, -{ - /// Create a new `DynQueue` from a `Vec` - #[inline] - pub fn new(lifo: U) -> Self { - Self(Arc::new(DynQueueInner(RwLock::new(lifo), PhantomData))) - } -} - impl<'a, T, U> UnindexedProducer for DynQueue<'a, T, U> where T: Send + Sync, - U: Queue + Send + Sync, + U: IntoDynQueue + Queue + Send + Sync, { type Item = (DynQueueHandle<'a, T, U>, T); fn split(self) -> (Self, Option) { - let len = { - let q = (self.0).0.read().unwrap(); - q.len() - }; + let len = (self.0).0.len(); + if len >= 2 { - let new_q = { - let mut q = (self.0).0.write().unwrap(); - let split_off = q.split_off(len / 2); - DynQueue::new(split_off) - }; - (self, Some(new_q)) + let new_q = (self.0).0.split_off(len / 2); + (self, Some(new_q.into_dyn_queue())) } else { (self, None) } @@ -209,10 +258,7 @@ where { let mut folder = folder; loop { - let ret = { - let mut q = (self.0).0.write().unwrap(); - q.pop() - }; + let ret = (self.0).0.pop(); if let Some(v) = ret { folder = folder.consume((DynQueueHandle(self.0.clone()), v)); @@ -233,7 +279,7 @@ where impl<'a, T, U> rayon::iter::ParallelIterator for DynQueue<'a, T, U> where T: Send + Sync, - U: Queue + Send + Sync, + U: IntoDynQueue + Queue + Send + Sync, { type Item = (DynQueueHandle<'a, T, U>, T); diff --git a/src/tests.rs b/src/tests.rs index f9f8a49..5262774 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -1,4 +1,4 @@ -use crate::{DynQueue, DynQueueHandle, Queue}; +use crate::{DynQueueHandle, IntoDynQueue, Queue}; use std::collections::VecDeque; const SLEEP_MS: u64 = 10; @@ -49,7 +49,7 @@ fn dynqueue_iter_test_const_sleep() { let med = expected.iter().sum::() / expected.iter().count() as u64; - let jq = DynQueue::new(get_input()); + let jq = get_input().into_dyn_queue(); let now = std::time::Instant::now(); let mut res = jq @@ -79,13 +79,13 @@ fn dynqueue_iter_test_const_sleep_segqueue() { let expected = get_expected(); let med = expected.iter().sum::() / expected.iter().count() as u64; - let q = SegQueue::new(); - get_input().drain(..).for_each(|ele| q.push(ele)); + let jq = SegQueue::new(); + get_input().drain(..).for_each(|ele| jq.push(ele)); - let jq = DynQueue::new(q); let now = std::time::Instant::now(); let mut res = jq + .into_dyn_queue() .into_par_iter() .map(handle_queue) .map(|v| { @@ -111,10 +111,11 @@ fn dynqueue_iter_test_const_sleep_vecdeque() { let med = expected.iter().sum::() / expected.iter().count() as u64; - let jq = DynQueue::new(VecDeque::from(get_input())); + let jq = VecDeque::from(get_input()); let now = std::time::Instant::now(); let mut res = jq + .into_dyn_queue() .into_par_iter() .map(handle_queue) .map(|v| { @@ -137,11 +138,12 @@ fn dynqueue_iter_test_sleep_v() { use rayon::iter::ParallelIterator as _; use std::time::Duration; - let jq = DynQueue::new(get_input()); + let jq = get_input(); let now = std::time::Instant::now(); let mut res = jq + .into_dyn_queue() .into_par_iter() .map(handle_queue) .map(|v| { @@ -161,11 +163,12 @@ fn dynqueue_iter_test_sleep_inv_v() { use rayon::iter::ParallelIterator as _; use std::time::Duration; - let jq = DynQueue::new(get_input()); + let jq = get_input(); let now = std::time::Instant::now(); let mut res = jq + .into_dyn_queue() .into_par_iter() .map(handle_queue) .map(|v| { From e6658a864e28d8378d4e1ecfd2ba80bb076447e0 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 20 Jul 2020 13:52:58 +0200 Subject: [PATCH 08/17] (cargo-release) version 0.2.0 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 5bbc133..935354a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dynqueue" -version = "0.1.4-alpha.0" +version = "0.2.0" authors = ["Harald Hoyer "] edition = "2018" From 3940c8807a83cad00fe2336189cde0c81d3992a7 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 20 Jul 2020 13:54:43 +0200 Subject: [PATCH 09/17] README.md: add ChangeLog --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 931896a..3b2e2f7 100644 --- a/README.md +++ b/README.md @@ -32,3 +32,11 @@ fn main() { * `crossbeam-queue` : to use `crossbeam::queue::SegQueue` as the inner collection. +## Changelog + +### 0.2.0 +- introduce `IntoDynQueue` +- handle lockless collections + +### 0.1.0 +- initial version From f4d6f248a85eb0a0152ad3df8714e8c99f98770c Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 20 Jul 2020 13:55:06 +0200 Subject: [PATCH 10/17] (cargo-release) version 0.2.1 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 935354a..15a05bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dynqueue" -version = "0.2.0" +version = "0.2.1" authors = ["Harald Hoyer "] edition = "2018" From 5dc28b5be527bb20031ea91852cd758cd0609dcf Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 20 Jul 2020 13:55:20 +0200 Subject: [PATCH 11/17] (cargo-release) start next development iteration 0.2.2-alpha.0 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 15a05bb..648f7da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dynqueue" -version = "0.2.1" +version = "0.2.2-alpha.0" authors = ["Harald Hoyer "] edition = "2018" From 62e76f1774ffd3559354366ab78ca9311fca6a14 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 2 Sep 2020 19:31:46 +0000 Subject: [PATCH 12/17] Create Dependabot config file --- .github/dependabot.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5cde165 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: +- package-ecosystem: cargo + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 From edb93314e3315f3b774a10009ebb85d271d6a54b Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 12 Oct 2020 09:37:04 +0200 Subject: [PATCH 13/17] coverage: only run on branch master --- .github/workflows/coverage.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index f4b77d5..d8af1b2 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,6 +1,13 @@ name: coverage -on: [ "push" , "pull_request" ] +on: + push: + branches: + - master + pull_request: + branches: + - master + jobs: test: name: coverage From 8d046cb5024bf66c37efabb6a7d50c2ed74bf072 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 12 Oct 2020 09:41:05 +0200 Subject: [PATCH 14/17] CI: use --all-features --- .github/workflows/rust.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a9d44c6..6724628 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -16,6 +16,6 @@ jobs: - name: Run fmt run: cargo fmt --all -- --check - name: Build - run: cargo build --verbose + run: cargo build --verbose --all-features - name: Run tests - run: cargo test --verbose + run: cargo test --verbose --all-features From f79482bb9aa543b3d10f0fb685d03b46b092acb5 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 12 Oct 2020 10:51:34 +0200 Subject: [PATCH 15/17] Update crossbeam-queue requirement from 0.2 to 0.3 --- Cargo.toml | 2 +- src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 648f7da..5fb46f5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,4 +16,4 @@ categories = [ "concurrency" ] [dependencies] rayon = "1.3" -crossbeam-queue = { version = "0.2", optional = true } +crossbeam-queue = { version = "0.3", optional = true } diff --git a/src/lib.rs b/src/lib.rs index e822ae0..733cbf9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -198,7 +198,7 @@ impl Queue for SegQueue { #[inline(always)] fn pop(&self) -> Option { - SegQueue::pop(self).ok() + SegQueue::pop(self) } #[inline(always)] From 68ca3cd6fc551e9705b675a113f78cb0aaef4ed1 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 12 Oct 2020 10:54:58 +0200 Subject: [PATCH 16/17] (cargo-release) version 0.3.0 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 5fb46f5..db8823c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dynqueue" -version = "0.2.2-alpha.0" +version = "0.3.0" authors = ["Harald Hoyer "] edition = "2018" From 6ac99408c2f36e1f509b179265a43dd069c6a1e3 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 12 Oct 2020 10:55:30 +0200 Subject: [PATCH 17/17] (cargo-release) start next development iteration 0.3.1-alpha.0 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index db8823c..c3396da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dynqueue" -version = "0.3.0" +version = "0.3.1-alpha.0" authors = ["Harald Hoyer "] edition = "2018"