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

[browser][MT] add memory barriers before sending messages to other workers #112199

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

pavelsavara
Copy link
Member

@pavelsavara pavelsavara commented Feb 5, 2025

In hope it would solve some of the deadlocks, by introducing __sync_synchronize which I believe is atomic.fence

#106094
#104492
#104203

@pavelsavara pavelsavara added arch-wasm WebAssembly architecture area-VM-threading-mono os-browser Browser variant of arch-wasm labels Feb 5, 2025
@pavelsavara pavelsavara added this to the 10.0.0 milestone Feb 5, 2025
@pavelsavara pavelsavara self-assigned this Feb 5, 2025
@pavelsavara pavelsavara changed the title [browser] emscripten_atomic_fence [browser] mono_memory_barrier Feb 5, 2025
@pavelsavara pavelsavara changed the title [browser] mono_memory_barrier [browser][MT] add memory barriers before sending messages to other workers Feb 6, 2025
@@ -311,6 +311,9 @@ mono_threads_platform_in_critical_region (THREAD_INFO_TYPE *info)
void
mono_memory_barrier_process_wide (void)
{
#ifndef DISABLE_THREADS
mono_memory_barrier ();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this is not enough for GC. Maybe we need to set barrier on all threads ? How?

@pavelsavara pavelsavara requested a review from kg February 6, 2025 10:20
@pavelsavara
Copy link
Member Author

Alternatively there is emscripten_atomic_fence but I can't find the way how to #include it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-wasm WebAssembly architecture area-VM-threading-mono os-browser Browser variant of arch-wasm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant