context_bind 0.0.2

Simple M:N threading library. Should support Linux, MacOS, Free/OpenBSD, and Windows for x86/64, and aarch32/64
Documentation
  • Coverage
  • 35%
    7 out of 20 items documented2 out of 7 items with examples
  • Size
  • Source code size: 795.98 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 416.52 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 22s Average build duration of successful builds.
  • all releases: 22s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Documentation
  • valarauca/context_bind
    1 0 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • valarauca

context_bind

Binds I want out of context-rs

Documents

These are simple bindings to context lib. The goal is to make a more object orriented runtime. With a free return function, that can be more easily embedded within external libraries (the goal is to make it easier to embed async-mio functionality).


    use context_bind::{Routine,StackSize,swap};
    
    let lambda = Box::new(||{
        for i in 0usize.. {
            swap(i*2);
        }
    });
    let lambda2 = Box::new(||{
        for i in 0usize.. {
            swap(i*4);
        }
    });
    let mut dut0 = Routine::new(lambda,1,StackSize::KiB8).unwrap();
    let mut dut1 = Routine::new(lambda2,2,StackSize::KiB8).unwrap();
    for x in 0..10 {
        let a = dut0.exec(0);
        let b = dut1.exec(0);
        assert_eq!(a,x*2);
        assert_eq!(b,x*4);
    }

To integrate use the following in your Cargo.toml file.

[dependencies]
context_bindings = "0.0.1"

A special thanks to the authors of context-rs without this library would not exist.

Y. T. CHUNG

Leonard Hecker