SC: Update sync_call_wasm_alloc
upon max_sync_call_depth
changes
#1269
Labels
Milestone
sync_call_wasm_alloc
upon max_sync_call_depth
changes
#1269
sync_call_wasm_alloc
is a thread_local vector storingmax_sync_call_depth
of wasm allocators per thread (main and read-only threads). Whenmax_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.
The text was updated successfully, but these errors were encountered: