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.