Skip to content
Snippets Groups Projects
  1. Jan 25, 2019
  2. Jan 24, 2019
  3. Jan 23, 2019
    • Jon Gjengset's avatar
      0ec8986b
    • Jon Gjengset's avatar
      Remove T: Debug bound on mpsc Debug impls (#866) · c6f8bdb2
      Jon Gjengset authored
      Following from https://github.com/tokio-rs/tokio/pull/865, this PR
      removes `#[derive(Debug)]` on `mpsc` sender and receiver types in favor
      of explicit `impl fmt::Debug` blocks that don't have a `T: fmt::Debug`
      bound.
      c6f8bdb2
    • Jon Gjengset's avatar
      Explicit impl Clone for tx to avoid T: Clone (#865) · c6f9a069
      Jon Gjengset authored
      `#[derive(Clone)]` on a type `struct Foo<T>` adds an impl that requires that
      `T: Clone`:
      
      ```rust
      impl<T: Clone> Clone for Foo<T>
      ```
      
      which is unfortunate in the case of senders, because we don't want to require
      that the items being sent are `Clone` for the channel sender to be `Clone`.
      This PR adds an explicit `impl Clone` for the bounded and unbounded sender
      types which does not have the `T: Clone` bound.
      
      Note that this is _also_ an issue with `#[derive(Debug)]`, but that one is
      harder to work around as `chan::Tx` _also_ has `#[derive(Debug)]`, as does
      `chan::Chan`, so we'd have to add explicit impls for all of them to make
      progress.
      c6f9a069
  4. Jan 22, 2019
    • Sean McArthur's avatar
      9f356d62
    • Carl Lerche's avatar
      Introduce tokio-sync crate containing synchronization primitives. (#839) · 13083153
      Carl Lerche authored
      Introduce a tokio-sync crate containing useful synchronization primitives for programs
      written using Tokio.
      
      The initial release contains:
      
      * An mpsc channel
      * A oneshot channel
      * A semaphore implementation
      * An `AtomicTask` primitive.
      
      The `oneshot` and `mpsc` channels are new implementations providing improved
      performance characteristics. In some benchmarks, the new mpsc channel shows
      up to 7x improvement over the version provided by the `futures` crate. Unfortunately,
      the `oneshot` implementation only provides a slight performance improvement as it
      is mostly limited by the `futures` 0.1 task system. Once updated to the `std` version
      of `Future` (currently nightly only), much greater performance improvements should
      be achievable by `oneshot`.
      
      Additionally, he implementations provided here are checked using
      [Loom](http://github.com/carllerche/loom/), which provides greater confidence of
      correctness.
      13083153
  5. Jan 20, 2019
  6. Jan 17, 2019
    • Stjepan Glavina's avatar
      threadpool: drop incomplete tasks on shutdown (#722) · 4c8f274d
      Stjepan Glavina authored
      ## Motivation
      
      When the thread pool shuts down, futures that have been polled at least once but not completed yet are simply leaked. We should drop them instead.
      
      ## Solution
      
      Multiple changes are introduced:
      
      * Tasks are assigned a home worker the first time they are polled.
      
      * Each worker contains a set of tasks (`Arc<Task>`) it is home to. When a task is assigned a home worker, it is registered in that worker's set of tasks. When the task is completed, it is unregistered from the set.
      
      * When the thread pool shuts down and after all worker threads stop, the remaining tasks in workers' sets are aborted, i.e. they are switched to the `Aborted` state and their `Future`s are dropped.
      
      * The thread pool shutdown process is refactored to make it more robust. We don't  track the number of active threads manually anymore. Instead, there's  `Arc<ShutdownTrigger>` that aborts remaining tasks and completes the `Shutdown` future once it gets destroyed (when all `Worker`s and `ThreadPool` get dropped because they're the only ones to contain strong references to the `ShutdownTrigger`).
      
      Closes #424 
      Closes #428
      4c8f274d
  7. Jan 13, 2019
  8. Jan 12, 2019
  9. Jan 10, 2019
  10. Jan 08, 2019
  11. Jan 07, 2019
  12. Jan 05, 2019
  13. Jan 04, 2019
    • Sean McArthur's avatar
      Provide optional features on tokio crate (#808) · 76198f63
      Sean McArthur authored
      Disabling all features means the only dependency is `futures`.
      
      Relevant pieces of the API can then be enabled with the following features:
      
      - `codec`
      - `fs`
      - `io`
      - `reactor`
      - `tcp`
      - `timer`
      - `udp`
      - `uds`
      
      This also introduces the beginnings of enabling only certain pieces of the `Runtime`. As a start, the entire default runtime API is enabled via the `rt-full` feature.
      76198f63
    • Carl Lerche's avatar
      travis: remove commented out code. (#828) · 39dc5706
      Carl Lerche authored
      The commented out lines are no longer relevant and will not be brought
      back.
      39dc5706
  14. Jan 03, 2019
  15. Jan 02, 2019
  16. Dec 29, 2018
  17. Dec 28, 2018
  18. Dec 17, 2018
Loading