//= { //= "output": { //= "2": [ //= "", //= true //= ], //= "1": [ //= "", //= true //= ] //= }, //= "children": [ //= { //= "output": { //= "1": [ //= "hi 3\n", //= true //= ], //= "2": [ //= "", //= true //= ] //= }, //= "children": [], //= "exit": "Success" //= }, //= { //= "output": { //= "2": [ //= "", //= true //= ], //= "1": [ //= "hi 8\n", //= true //= ] //= }, //= "children": [], //= "exit": "Success" //= }, //= { //= "output": { //= "1": [ //= "hi 4\n", //= true //= ], //= "2": [ //= "", //= true //= ] //= }, //= "children": [], //= "exit": "Success" //= }, //= { //= "output": { //= "1": [ //= "hi 2\n", //= true //= ], //= "2": [ //= "", //= true //= ] //= }, //= "children": [], //= "exit": "Success" //= }, //= { //= "output": { //= "1": [ //= "hi 6\n", //= true //= ], //= "2": [ //= "", //= true //= ] //= }, //= "children": [], //= "exit": "Success" //= }, //= { //= "output": { //= "1": [ //= "hi 9\n", //= true //= ], //= "2": [ //= "", //= true //= ] //= }, //= "children": [], //= "exit": "Success" //= }, //= { //= "output": { //= "1": [ //= "hi 5\n", //= true //= ], //= "2": [ //= "", //= true //= ] //= }, //= "children": [], //= "exit": "Success" //= }, //= { //= "output": { //= "1": [ //= "hi 0\n", //= true //= ], //= "2": [ //= "", //= true //= ] //= }, //= "children": [], //= "exit": "Success" //= }, //= { //= "output": { //= "2": [ //= "", //= true //= ], //= "1": [ //= "hi 1\n", //= true //= ] //= }, //= "children": [], //= "exit": "Success" //= }, //= { //= "output": { //= "2": [ //= "", //= true //= ], //= "1": [ //= "hi 7\n", //= true //= ] //= }, //= "children": [], //= "exit": "Success" //= } //= ], //= "exit": "Success" //= } use constellation::*; use std::{thread, time}; fn main() { init(Resources { mem: 20 * Mem::MIB, ..Resources::default() }); for i in 0..10 { let _pid = spawn( Resources { mem: 20 * Mem::MIB, ..Resources::default() }, FnOnce!(move |_parent| { thread::sleep(time::Duration::new(0, 10_000_000) * i); println!("hi {}", i); }), ) .block() .expect("spawn() failed to allocate process"); } }