Skip to content

Navigation Menu

Sign in
Sign up

How much overlap is there between this and multi-threading? #38

dead-claudia started this conversation in General
Discussion options

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:

Operation Linux processes Erlang processes POSIX Threads C# Tasks Tokio tasks Go's goroutines
Spawn clone(...) spawn and friends pthread_create Task.run(...) tokio::spawn(async { ... }) go ...
Yield sched_yield() yield() sched_yield() await Task.Yield() tokio::task::yield_now()
Return return from main return from function return from function return from delegate return from task
Exit _exit(code) exit(Reason) pthread_exit(retval) runtime.Goexit()
Suspend kill(pid, SIGSTOP) suspend_process indirectly via channel receive indirectly via tokio::sync::oneshot indirectly via channel receive
Resume kill(pid, SIGCONT) resume_process indirectly via channel send indirectly via tokio::sync::oneshot indirectly via channel send
Terminate kill(pid, SIGTERM) exit(Pid, normal) pthread_cancel(tid) indirectly via cancellation tokens indirectly via channels
Kill kill(pid, SIGKILL) exit(Pid, kill) join_handle.abort()
Wait wait(pid, &status, 0) monitor(process, Pid) (indirectly) pthread_join(tid, &retval) await, task.Wait() join_handle.await indirectly via channels
You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /