Crates.io | jobsys |
lib.rs | jobsys |
version | 0.2.0 |
source | src |
created_at | 2021-03-16 20:06:10.129761 |
updated_at | 2021-03-25 07:55:06.776843 |
description | Lockless Work Stealing Job System |
homepage | https://gitlab.com/AngryPixel/jobsys |
repository | https://gitlab.com/AngryPixel/jobsys |
max_upload_size | |
id | 369825 |
size | 61,997 |
Provides an implementation of a Lockless Work Stealing Job System which, after initialization, does not consume additional memory to schedule jobs.
This crate requires rust edition 2018 and can be run with stable. It has been tested with rust version 1.50.0.
For more details, please consult the crate's documentation
Note: It's recommended to use version 0.2.0 going forward as it fixes many issues in the original release.
use jobsys::{JobSystem, JobScope, JobInstance};
fn main() {
let thread_count = 4_usize;
let job_capacity = 512_usize;
let job_sys = JobSystem::new(thread_count, job_capacity).unwrap();
let job_scope = JobScope::new_from_system(&job_sys);
let job_instance = JobInstance::create(&job_scope, || {
println!("Hello from Job Instance");
}).unwrap();
job_instance.wait_with(|| println!("Waiting on Job to Finish")).expect("Failed to wait on job");
}