entangled 1.3.0

A simple fork-join task executor.
Documentation

entangled

Latest version Documentation ZLIB MIT Apache

Entangled provides a thread pool based on the async-executor crate to spawn async futures on.

It's main selling point is the "scoped spawn" functionality, which is essentially forking tasks from the main thread, which have access to the stack of the main thread and joins them after they have completed.

Example

use entangled::*;
use std::sync::atomic::*;

fn main() {
    let pool = ThreadPool::new(
        ThreadPoolDescriptor::default()
    ).expect("can't create task pool");

    let counter = AtomicI32::new(0);
    let ref_counter = &counter;

    pool.scope(|scope| {
        for _ in 0..10 {
            scope.spawn(async {
                ref_counter.fetch_add(1, Ordering::Relaxed);
            });
        }
    });

    assert_eq!(counter.load(Ordering::Relaxed), 10);
}

Credits

Originally based on bevy_tasks crate, but was completely rewritten with version 1.2

License

Licensed under Apache-2.0 or MIT or ZLIB.