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

SC: Update sync_call_wasm_alloc upon max_sync_call_depth changes #1269

Open
linh2931 opened this issue Mar 21, 2025 · 0 comments
Open

SC: Update sync_call_wasm_alloc upon max_sync_call_depth changes #1269

linh2931 opened this issue Mar 21, 2025 · 0 comments

Comments

@linh2931
Copy link
Member

sync_call_wasm_alloc is a thread_local vector storing max_sync_call_depth of wasm allocators per thread (main and read-only threads). When max_sync_call_depth changes, the vector must be resized.

One way is to emit a signal (new max_sync_call_depth) to producer_plugin, the plugin posts a task to the thread pool, and the pool runs the task on each thread in the pool. But it is not clear how to make sure the pool runs the task on each thread.

@spoonincode suggested use something like boost lockfree queue to have a central pool of wasm allocators.

@greg7mdp suggested make max_sync_call_depth an atomic, and check its value on each thread when accessing sync_call_wasm_alloc , and resize the vector if the value of max_sync_call_depth has changed.

Need to do some experiment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants