Skip to content

Instantly share code, notes, and snippets.

@doublec
Created July 16, 2012 11:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doublec/3122131 to your computer and use it in GitHub Desktop.
Save doublec/3122131 to your computer and use it in GitHub Desktop.
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 ())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment