-
Notifications
You must be signed in to change notification settings - Fork 241
WASIp3 Cooperative Threading #799
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
Draft
TartanLlama
wants to merge
48
commits into
WebAssembly:main
Choose a base branch
from
TartanLlama:sy/coop-threading
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
421005c
Restructure thread impls
TartanLlama fd62b0b
Cmake fixes
TartanLlama 974fc8a
Common files
TartanLlama 2789d8f
Rename folder
TartanLlama 8bf9a00
First pass
TartanLlama 9f4cb70
Merge branch 'main' into sy/coop-threading
TartanLlama ed7f5d2
Merge in WASIP3
TartanLlama bd108e2
Linking fixes
TartanLlama 5f6f5ae
Various clocks and build fixes
TartanLlama 6bc21e1
Lock fixes
TartanLlama 2f613cc
Sysconf changes
TartanLlama 8f2a99c
sem_destroy fixes
TartanLlama 16d406a
Link and test updates
TartanLlama 5b95b09
Merge branch 'main' into sy/coop-threading
TartanLlama 72ac6f8
WASIp3 bump
TartanLlama 36d2c17
crt1 bump
TartanLlama aba8568
Fix bad lock initializations
TartanLlama 3647168
Ifdef lock
TartanLlama e055edf
typedef locks with no threading
TartanLlama c10da06
Unused variable warnings
TartanLlama 7b431f1
More lock nonsense
TartanLlama 787c289
Redo lock changes
TartanLlama 1000351
Move lock_ptc
TartanLlama 1fc2a40
OFL lock fix
TartanLlama c37f771
Add wasi-threads sem_destroy
TartanLlama 0ef525a
wasi-threads fixes
TartanLlama cfec5f1
wasi-threads fixes
TartanLlama c78d35c
wasi-threads fixes
TartanLlama 73dff1a
wasi-threads fixes
TartanLlama df6a4da
Pointer shenanigans
TartanLlama 35b1ed9
Pointer shenanigans
TartanLlama d8fb9a6
Pointer shenanigans
TartanLlama cb5f6a4
More lock changes
TartanLlama cce6bc0
Defined symbol changes
TartanLlama 53be6e5
Bump test suite
TartanLlama 6e3518a
Call compiler-rt
TartanLlama ffdf6b0
Merge branch 'main' into sy/coop-threading
TartanLlama fd5840e
Correct mtx cmake
TartanLlama ddd75e1
Update
TartanLlama e02f07d
Merge branch 'main' into sy/coop-threading
TartanLlama 4d2e463
Rename coop threads macro
TartanLlama d7961f8
Lock name fixes
TartanLlama 8fe99d7
Fix macro name
TartanLlama 84383bb
Fix lock issue
TartanLlama 5d1f328
Remove stale files
TartanLlama d249f32
Merge branch 'main' into sy/coop-threading
TartanLlama 3c017ff
Move thread index retrieval
TartanLlama 112e662
Move TLS allocation to C
TartanLlama File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| .text | ||
|
|
||
| .export_name __wasm_init_task, __wasm_init_task | ||
| .export_name __wasm_init_async_task, __wasm_init_async_task | ||
|
|
||
| .globaltype __init_stack_pointer, i32, immutable | ||
| .globaltype __init_tls_base, i32, immutable | ||
| .globaltype __tls_size, i32, immutable | ||
| .globaltype __tls_align, i32, immutable | ||
|
|
||
| .functype __wasm_set_stack_pointer (i32) -> () | ||
| .functype __wasm_set_tls_base (i32) -> () | ||
|
|
||
| .functype malloc (i32) -> (i32) | ||
| .functype __copy_tls (i32) -> (i32) | ||
| .functype __allocate_tls () -> (i32) | ||
|
|
||
| .globl __wasm_init_task | ||
| .type __wasm_init_task,@function | ||
| .globl __wasm_init_async_task | ||
| .type __wasm_init_async_task,@function | ||
|
|
||
| .functype __wasi_init_tp() -> () | ||
|
|
||
| __wasm_init_task: | ||
| .functype __wasm_init_task () -> () | ||
|
|
||
| global.get __init_stack_pointer | ||
| call __wasm_set_stack_pointer | ||
|
|
||
| global.get __init_tls_base | ||
| call __wasm_set_tls_base | ||
|
|
||
| # Allocate a new TLS area | ||
| call __allocate_tls | ||
| call __copy_tls | ||
| call __wasm_set_tls_base | ||
|
|
||
| call __wasi_init_tp | ||
|
|
||
| end_function | ||
|
|
||
| __wasm_init_async_task: | ||
| .functype __wasm_init_async_task () -> () | ||
|
|
||
| # malloc and __init_tls may use the stack pointer and TLS base, so set those first | ||
| # to the statically-allocated values used for synchronous tasks. | ||
| global.get __init_stack_pointer | ||
| call __wasm_set_stack_pointer | ||
|
|
||
| global.get __init_tls_base | ||
| call __wasm_set_tls_base | ||
|
|
||
| # Allocate a new stack | ||
| # Constant copied from __default_stacksize, TODO(wasip3) find a way | ||
| # to reference this constant without linking failing for shared libraries, | ||
| # i.e. a position-independent data reference. | ||
| i32.const 131072 | ||
| call malloc | ||
| call __wasm_set_stack_pointer | ||
|
|
||
| # Allocate a new TLS area | ||
| call __allocate_tls | ||
| call __copy_tls | ||
| call __wasm_set_tls_base | ||
|
|
||
| call __wasi_init_tp | ||
|
|
||
| end_function | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.