Skip to content
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

feat(api): Add SharedMemoryHandle #4385

Merged
merged 8 commits into from
Jan 23, 2024
Merged

feat(api): Add SharedMemoryHandle #4385

merged 8 commits into from
Jan 23, 2024

Conversation

theduke
Copy link
Contributor

@theduke theduke commented Jan 3, 2024

Allows to trigger atomics related operations on a memory that supports
interacting with the atomics layer though a shared handle.

Note that this needs to be a separate handle that is not a store reference, because it needs to be accessible while an instance is executing.

Right now only final operations are exposed that wake up all atomic
waiters, and that allow disabling atomics.

This is required for forceful shutdown of instances that keep
hot-looping on atomics, and will be used from WASIX.

Part of #4383

@theduke theduke requested a review from syrusakbary as a code owner January 3, 2024 09:05
@theduke theduke force-pushed the issue-4383-wasix-atomics branch 2 times, most recently from 6ff03c0 to 95bcf23 Compare January 3, 2024 13:36
@theduke
Copy link
Contributor Author

theduke commented Jan 3, 2024

Pushed a small change that makes the handle only hold a weak reference to the underlying atomics handler to avoid prolonging the memory lifetime.

@theduke theduke force-pushed the issue-4383-wasix-atomics branch 2 times, most recently from cb8a1e7 to 1f8d888 Compare January 5, 2024 10:49
@theduke theduke force-pushed the issue-4383-wasix-atomics branch from 8e8a99b to 49ca321 Compare January 16, 2024 21:14
Allows to trigger atomics related operations on a memory that supports
interacting with the atomics layer.

It adds a shared_handle() method to `Memory`.

Right now only final operations are exposed that wake up all atomic
waiters, and that allow disabling atomics.

This is required for forceful shutdown of instances that keep
hot-looping on atomics, and will be used from WASIX.
Prevents prolonging the thread conditions lifetime unneccessarily.
Provide a wrapper around Memory that also holds the SharedMemoryOps.
@theduke theduke force-pushed the issue-4383-wasix-atomics branch from 49ca321 to c8df06a Compare January 22, 2024 12:52
@theduke theduke force-pushed the issue-4383-wasix-atomics branch from 3191b0b to 5efe9bb Compare January 23, 2024 10:24
@theduke theduke merged commit 6263903 into master Jan 23, 2024
52 checks passed
@theduke theduke deleted the issue-4383-wasix-atomics branch January 23, 2024 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants