-
Notifications
You must be signed in to change notification settings - Fork 636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wasi-threads: basic simplistic implementation of wasi-threads proposal #1638
Conversation
59fb546
to
efb6601
Compare
@loganek Thanks for uploading the PR! I have created branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
int global_value = 0; | ||
|
||
void | ||
sleep(int64_t time_ns) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please avoid overriding unistd.h sleep(3). my suggestion is sleep_ns.
pthread_cond_t cond; | ||
pthread_mutex_t mp; | ||
|
||
int global_value = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
volatile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
answering myself, volatile isn't necessary here as surrounded by mutex calls.
info->start_func = start_func; | ||
info->exec_env = new_exec_env; | ||
|
||
ret = pthread_create(&th, NULL, thread_start, info); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess you should use os_thread_create.
Closing this PR in favor of the #1783 PR (and further PRs). |
This a simpler version of the PR: #1638
…e#1783) This a simpler version of the PR: bytecodealliance#1638
…e#1783) This a simpler version of the PR: bytecodealliance#1638
wasi-threads proposal: https://github.com/WebAssembly/wasi-threads
This is very very basic implementation, probably doesn't cover a lot of corner cases. I open the PR here to get early feedback on the direction, missing bits and suggestions.
Also, I think it'd be good to have a separate branch for that (dev/wasi-threads?) so if we can have it setup that'd be great.