Skip to content

Commit 2d43fee

Browse files
committed
review: link to implementation
1 parent 24ffefd commit 2d43fee

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,16 @@ threads.
8484

8585
### API walk-through
8686

87-
The API requires the addition of a single function. In pseudo-code:
87+
The API consists of a single function. In pseudo-code:
8888

8989
```C
90-
status thread_spawn(thread_start_func* start_func, thread_start_arg* start_arg);
90+
status wasi_thread_spawn(thread_start_arg* start_arg);
9191
```
9292
93-
Any necessary locking/signaling/thread-local storage will be implemented using
94-
existing instructions available in WebAssembly. Ideally, users will never use
93+
The host implementing `wasi_thread_spawn` will call a predetermined function
94+
export (`wasi_thread_start`) in a new WebAssembly instance. Any necessary
95+
locking/signaling/thread-local storage will be implemented using existing
96+
instructions available in WebAssembly. Ideally, users will never use
9597
`thread_spawn` directly but rather compile their threaded code from a language
9698
that supports threads (see below).
9799
@@ -203,6 +205,12 @@ and what can safely be skipped until some later date.
203205
204206
[deprecated]: https://man7.org/linux/man-pages/man3/pthread_yield.3.html
205207
208+
##### What _has_ been implemented
209+
210+
`wasi-libc` contains an implementation of `pthreads` using `wasi-threads`. The
211+
implementation is currently in progress: see the [list of threads-related
212+
PRs](https://github.com/WebAssembly/wasi-libc/pulls?q=is%3Apr+threads).
213+
206214
#### Design choice: instance-per-thread
207215
208216
A thread spawning mechanism for WebAssembly could be implemented in various

0 commit comments

Comments
 (0)