public
Created

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
staload "contrib/task/SATS/task.sats"
dynload "contrib/task/DATS/task.dats"
 
fn do_main (sch: scheduler) = begin
set_global_scheduler (sch);
 
task_spawn (16384, lam () => begin
print ("hello\n");
task_yield ();
print ("world\n")
end);
 
task_spawn (16384, lam () => begin
task_spawn (16384, lam () => begin
print ("Task start\n");
task_yield ();
print ("Task end\n")
end);
print ("Test1\n");
task_yield ();
print ("Test2\n")
end);
 
run_global_scheduler ();
 
unset_global_scheduler (sch);
scheduler_free (sch)
end
 
implement main (argc, argv) = do_main (scheduler_new ())

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.