Single-future, #![no_std] executor based on event bitmasks

Overview

nb-executor

This crate provides an async executor with the following features:

  • #![no_std], does not depend on alloc.

  • #![forbid(unsafe_code)].

  • Runs a single future on the current thread of execution. Concurrency can be achieved with multiplexers such as futures::join!(). The executor itself is !Send + !Sync.

  • A Sync-friendly, atomic 32-bit event mask is shared between the executor and all external event sources. Users define an event set (with, for example, bitflags) to make the event mask meaningful.

  • Wakeups correspond to edge-triggered signals. A shared reference to the event mask is sufficient to raise a signal.

  • Async code can drive non-blocking poll functions with a given signal mask. The poll function is attempted whenever any of the signals in the mask is raised until it resolves to its output. This is the primary mechanism for performing asynchronous work.

  • The future is polled only if an intersection exists between the current event mask and the combined signal mask. Likewise, a poll function won't be attempted if there is no intersection between its signal mask and a snapshot of the event mask taken just before polling the "root" future.

  • When further progress is presumed not to be currently possible, a user-provided park function is invoked. This function may enter an event-free context and then verify whether there is in fact no work to do right now. it may then suspend the executor in some particular way, such as a WFI/WFE-style operation on embedded firmware or std::thread::park() on hosted systems.

  • A no-op waker is used by default. It can be replaced for another one that cooperates with the park function.

License

nb-executor is licensed under Apache-2.0.

Contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in nb-executor by you shall be under the terms and conditions of the Apache-2.0 license, without any additional terms or conditions.

You might also like...
A cell-based esoteric programming language

Tape A cell-based esoteric programming language Tape is a cell-based, brainfuck-like programming language that has a readable syntax and a non-wasted

A collection of compilers based around compiling a high level language to a Brainfuck dialect.
A collection of compilers based around compiling a high level language to a Brainfuck dialect.

tf A collection of compilers based around compiling a high level language to a Brainfuck dialect. Built at, and for, the VolHacks V hackathon during O

Nimbus is a framework for building parachain consensus systems on cumulus-based parachains.

Cumulo -- Nimbus ⛈️ Nimbus is a framework for building parachain consensus systems on cumulus-based parachains. Given the regular six-second pulse-lik

cargo extension for flashing embedded rust programs via dfu based on jacobrosenthals cargo-hf2

cargo-dfu This crate provides a cargo subcommand to flash ELF binaries via dfu Most STM chips will probably work with this, although you might need to

A Rust Based GMod Module for finding system info.

gm_sysinfo Fetching System Information in Rust to Lua. Installation Download the Module. Compile it. Cry because it doesn't work. Spend 2 hours debugg

Pbot - pan93412's extensible userbot, which is full-documented, enginnered and based on Actor model.

pbot pan93412's extensible user bot, which is full-documented, engineered and based on Actor model. Usage Run cargo run --release [--features modules

Cloud-Based Microservice Performance Profiling Tool

Revelio Systems Revelio Systems is a student startup sponsored by UT Austin's Inventors Program in partnership with Trend Micro. Team: Tejas Saboo, So

A trading bot written in Rust based on the orderbook delta volume.

The strategy based on the concept of mean reversion. We look for large deviations in the volume delta of BTC-PERP on FTX at a depth of 1. These deviations could be caused by over-enthusiastic and over-leveraged market participants.

A Rust-based dropper for shellcode payloads.

A Rust-based dropper for shellcode payloads.

Owner
Alejandro Soto
Alejandro Soto
Primitive Roblox Lua executor

rulx Primitive Roblox Lua executor Build cargo build --target i686-pc-windows-msvc --release License rulx is free and open source software licensed un

ORC Free and Open Source Software 5 Aug 16, 2022
This crate defines a single macro that is a brainfunct compile-time interpreter.

Compile Protection This crate defines a single macro that is a brainfunct compile-time interpreter. One example is as follows #![recursion_limit = "18

John Marsden 7 Nov 29, 2021
CLI tool that make it easier to perform multiple lighthouse runs towards a single target and output the result in a "plotable" format.

Lighthouse Groupie CLI tool that make it easier to perform multiple lighthouse runs towards a single target and output the result in a "plotable" form

Polestar 1 Jan 12, 2022
Single-operator public liveness notification

Single-operator public liveness notification

Charlotte Som 1 Feb 16, 2022
dm-jitaux is a Rust-based JIT compiler using modified auxtools, dmasm and Inkwell LLVM wrapper for boosting Byond DM performance without any hassle!

dm-jitaux is a Rust-based JIT compiler using modified auxtools, dmasm and Inkwell LLVM wrapper for boosting Byond DM performance without any hassle (such as rewriting/refactroing your DM code).

SS220 20 Dec 13, 2022
mdzk is a plain text Zettelkasten system that is based on the mdBook API.

mdzk A lovingly designed system and static publishing tool for your plain text Zettelkasten mdzk is a plain text Zettelkasten system that is based on

mdzk 176 Jan 4, 2023
The Voting example based on MoonZoon and Solana.

Voting example The Rust-only Voting example based on MoonZoon and Solana. MoonZoon is a Rust Fullstack Framework. Solana is a decentralized blockchain

Martin Kavík 26 Dec 8, 2022
A rust-based extension module for Halo 3: MCC PC

halo3-rs This project is a rust-based extension module for Halo 3 in the Master Chief Collection on PC. The DLL wrapper contains a collection of patch

null 2 Sep 19, 2021
A Github Actions based CI release template for Rust binaries

Rust CI Release Template A Github Actions based CI release template. This repo serves as a live template, and reference for building your own CI power

null 60 Dec 9, 2022
A webhook-based Discord slash command library

Slashook A webhook-based Discord slash command library. This is a WIP project. Please note breaking changes can occur within minor releases until vers

Tonkku 11 Oct 18, 2022