How much overlap is there between this and multi-threading? #38
dead-claudia
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
My goal is just to spur a discussion, since cooperative tasks and preemptible threads do have a lot of common points of functionality. I'm not proposing anything concrete here, just noticing some similarities that might inform both this and WASI.
Here's a table describing what all functionality various things have:
clone(...)
spawn
and friendspthread_create
Task.run(...)
tokio::spawn(async { ... })
go ...
sched_yield()
yield()
sched_yield()
await Task.Yield()
tokio::task::yield_now()
main
_exit(code)
exit(Reason)
pthread_exit(retval)
runtime.Goexit()
kill(pid, SIGSTOP)
suspend_process
tokio::sync::oneshot
kill(pid, SIGCONT)
resume_process
tokio::sync::oneshot
kill(pid, SIGTERM)
exit(Pid, normal)
pthread_cancel(tid)
kill(pid, SIGKILL)
exit(Pid, kill)
join_handle.abort()
wait(pid, &status, 0)
monitor(process, Pid)
(indirectly)pthread_join(tid, &retval)
await
,task.Wait()
join_handle.await
Beta Was this translation helpful? Give feedback.
All reactions