Commit Graph

60 Commits

Author SHA1 Message Date
John Nunley ef512cb384
v1.11.0
Signed-off-by: John Nunley <dev@notgull.net>
2024-04-13 22:52:52 -07:00
James Liu 649bdfda23
Support racy initialization of an Executor's state
Fixes #89. Uses @notgull's suggestion of using a `AtomicPtr` with a racy initialization instead of a `OnceCell`.

For the addition of more `unsafe`, I added the `clippy::undocumented_unsafe_blocks` lint at a warn, and fixed a few of the remaining open clippy issues (i.e. `Waker::clone_from` already handling the case where they're equal).

Removing `async_lock` as a dependency shouldn't be a SemVer breaking change.
2024-04-08 19:41:14 -07:00
John Nunley 4b37c612f6 v1.10.0
Signed-off-by: John Nunley <dev@notgull.net>
2024-04-07 08:17:52 -07:00
John Nunley 17720b098a v1.9.1
Signed-off-by: John Nunley <dev@notgull.net>
2024-03-29 21:10:44 -07:00
John Nunley 00dbbbf85d Revert "feat: Use actual thread local queues instead of using a RwLock"
This reverts commit 7592d4188a.
2024-03-25 06:51:06 -07:00
John Nunley c90fd306cd Revert "bugfix: Account for local queue corner cases"
This reverts commit 22a9e8b305.
2024-03-25 06:51:06 -07:00
John Nunley 22a9e8b305 bugfix: Account for local queue corner cases
It turns out that with the current strategy it is possible for tasks to
be stuck in the local queue without any hope of being picked back up.
In practice this seems to happen when the only entities polling the
system are tickers, as opposed to runners. Since tickets don't steal
tasks, it is possible for tasks to be left over in the local queue that
don't filter out.

One possible solution is to make it so tickers steal tasks, but this
kind of defeats the point of tickers. So I've instead elected to replace
the current strategy with one that accounts for the corner cases with
local queues.

The main difference is that I replace the Sleepers struct with two
event_listener::Event's. One that handles tickers subscribed to the
global queue and one that handles tickers subscribed to the local queue.
The other main difference is that each local queue now has a reference
counter. If this count reaches zero, no tasks will be pushed to this
queue. Only runners increment or decrement this counter.

This makes the previously instituted tests pass, so hopefully this works
for most use cases.

Signed-off-by: John Nunley <dev@notgull.net>
2024-03-12 20:38:37 -07:00
John Nunley 2f3189a4b4
v1.9.0
Signed-off-by: John Nunley <dev@notgull.net>
2024-02-21 20:58:51 -08:00
James Liu 7592d4188a
feat: Use actual thread local queues instead of using a RwLock
Currently, runner local queues rely on a RwLock<Vec<Arc<ConcurrentQueue>>>> to store the queues instead of using actual thread-local storage.

This adds thread_local as a dependency, but this should allow the executor to work steal without needing to hold a lock, as well as allow tasks to schedule onto the local queue directly, where possible, instead of always relying on the global injector queue.

Fixes #62

Co-authored-by: John Nunley <jtnunley01@gmail.com>
2024-02-21 19:53:40 -08:00
Jacob Rothstein 0baba46152
chore: Bump async-task to v4.4.0
this crate depends on async_task::Builder, which was introduced in 4.4.0
2024-02-12 19:40:56 -08:00
dependabot[bot] 4fbe23af69
Update criterion requirement from 0.4 to 0.5 (#43)
Signed-off-by: dependabot[bot] <support@github.com>
2024-01-27 00:34:45 +09:00
John Nunley 6c70369102
ex: Use Semaphore instead of manual event-listener
Whoops, I accidentally reinvented a semaphore and made the example a lot
more complicated than it needed to be.

Signed-off-by: John Nunley <dev@notgull.net>
2024-01-08 16:01:07 -08:00
Taiki Endo 57fcc2d991 Relax MSRV to 1.60
https://github.com/smol-rs/futures-lite/pull/90
2024-01-07 07:07:37 +09:00
John Nunley d747bcd827
v1.8.0
Signed-off-by: John Nunley <dev@notgull.net>
2023-11-24 08:21:32 -08:00
John Nunley 4b1cf40142
v1.7.2
Signed-off-by: John Nunley <dev@notgull.net>
2023-11-18 09:26:16 -08:00
John Nunley 144b0576d1 Update to 2021 edition
Signed-off-by: John Nunley <dev@notgull.net>
2023-11-13 08:30:50 -08:00
John Nunley b140c46123 Fix dev-dependency WASM compilation issue
`futures-lite` in the dev dependencies added a `block_on` call that was
not present in the WASM build, causing a compile error. This PR makes
sure that the `std` feature of `futures-lite` is enabled in Cargo.toml.

This also adds a CI check to ensure that this doesn't happen again

Signed-off-by: John Nunley <dev@notgull.net>
2023-11-13 08:30:50 -08:00
John Nunley 1d4769a7b5
v1.7.1
Signed-off-by: John Nunley <dev@notgull.net>
2023-11-12 16:21:46 -08:00
John Nunley c7fd967c9e
v1.7.0
Signed-off-by: John Nunley <dev@notgull.net>
2023-11-05 17:24:42 -08:00
John Nunley e1e2ab11df Bump async-io, async-lock and futures-lite
Signed-off-by: John Nunley <dev@notgull.net>
2023-11-02 21:50:48 -07:00
dependabot[bot] b91875e73b
deps: Update async-channel requirement from 1.4.1 to 2.0.0
Updates the requirements on [async-channel](https://github.com/smol-rs/async-channel) to permit the latest version.
- [Release notes](https://github.com/smol-rs/async-channel/releases)
- [Changelog](https://github.com/smol-rs/async-channel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/async-channel/compare/v1.4.1...v2.0.0)

---
updated-dependencies:
- dependency-name: async-channel
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-30 20:54:02 -07:00
John Nunley 599c71a3f9
v1.6.0
Signed-off-by: John Nunley <dev@notgull.net>
2023-10-16 19:17:27 -07:00
John Nunley 917caad8b9
ex: Add an example of an executor with limited tasks
Signed-off-by: John Nunley <dev@notgull.net>
2023-10-15 19:26:22 -07:00
John Nunley 2cfb6e4ed0
v1.5.4
Signed-off-by: John Nunley <dev@notgull.net>
2023-09-27 21:17:03 -07:00
John Nunley 77b5b169c5
v1.5.3
Signed-off-by: John Nunley <dev@notgull.net>
2023-09-25 09:52:25 -07:00
John Nunley ecddfde87a
m: Remove unused memchr dependency
Signed-off-by: John Nunley <dev@notgull.net>
2023-09-23 11:01:56 -07:00
Taiki Endo 609aafb330 Bump MSRV to 1.61
```
error: package `memchr v2.6.3` cannot be built because it requires rustc 1.61 or newer, while the currently active rustc version is 1.60.0
```
2023-09-05 00:49:20 +09:00
John Nunley e19573367b
v1.5.2
Signed-off-by: John Nunley <dev@notgull.net>
2023-08-19 19:17:39 -07:00
John Nunley 1a9e08ce73
Use fastrand v2.0.0 (#45) 2023-06-09 17:53:03 -07:00
Yosh 85c20eb98b
Replace `num_cpus` crate with `std::thread` (#42) 2023-05-05 21:38:00 +09:00
John Nunley a438e9da8c
v1.5.1 (#40) 2023-04-07 11:01:23 -07:00
Taiki Endo b8885f9578 Bump MSRV to 1.48
async-lock 2.7.0 requires Rust 1.48.

```
error[E0658]: use of unstable library feature 'future_readiness_fns'
   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/async-lock-2.7.0/src/once_cell.rs:430:45
    |
430 |             self.initialize_or_wait(move || std::future::ready(closure()), &mut Blocking),
    |                                             ^^^^^^^^^^^^^^^^^^
    |
```
2023-03-06 01:43:03 +09:00
John Nunley a988ee3e46
m: Migrate benchmarks to criterion (#35)
* m: Migrate to criterion

* Update CI
2023-01-23 11:30:43 -08:00
Taiki Endo 00ea6cf6a1 Release 1.5.0 2022-11-09 11:45:41 +09:00
Taiki Endo c09ecba5bb Update concurrent-queue to 2 2022-11-09 11:45:41 +09:00
John Nunley 263ea89390
Replace once_cell with async-lock (#29) 2022-10-29 21:41:55 -07:00
Taiki Endo 16f0b9ca70 Bump MSRV to Rust 1.47
https://github.com/smol-rs/async-task/releases/tag/v4.3.0
2022-07-08 01:14:13 +09:00
Taiki Endo ee7bd4d2af Clean up CI config 2022-01-08 21:33:35 +09:00
Taiki Endo b9ac443e56 Update slab to 0.4.4 2021-12-30 09:36:58 +09:00
Taiki Endo edf0296f59 Bump to v1.4.1 2021-04-24 17:56:59 +09:00
Taiki Endo f25cd267ac Replace vec-arena with slab 2021-04-18 22:39:34 +09:00
Taiki Endo 4decd55ccb Remove readme field from Cargo.toml 2021-02-14 19:40:19 +09:00
Taiki Endo 64b80cf591 Update URLs 2020-12-26 23:47:13 +09:00
Stjepan Glavina 62a61401d1 Bump to v1.4.0 2020-11-10 15:56:55 +01:00
Stjepan Glavina 29ba8a72ad Update futures-lite 2020-10-09 14:49:25 +02:00
Stjepan Glavina 2fcbbdebb8 Add benchmarks 2020-10-08 14:28:45 +02:00
Stjepan Glavina 4079184178 Bump to v1.3.0 2020-09-20 16:32:51 +02:00
Stjepan Glavina e714ec4221 Bump to v1.2.0 2020-09-20 02:40:01 +02:00
Stjepan Glavina 8cea09da36 Update async-task 2020-09-20 02:36:54 +02:00
Stjepan Glavina 6f2b0b8a49 Make executors scoped 2020-09-19 22:38:11 +02:00