Implement suspend flags as atomic variable (#2361)
We have observed a significant performance degradation after merging https://github.com/bytecodealliance/wasm-micro-runtime/pull/1991 Instead of protecting suspend flags with a mutex, we implement the flags as atomic variable and only use mutex when atomics are not available on a given platform.
This commit is contained in:
@ -531,7 +531,8 @@ pthread_start_routine(void *arg)
|
||||
else {
|
||||
info_node->u.ret = (void *)(uintptr_t)argv[0];
|
||||
#ifdef OS_ENABLE_HW_BOUND_CHECK
|
||||
if (exec_env->suspend_flags.flags & 0x08)
|
||||
if (WASM_SUSPEND_FLAGS_GET(exec_env->suspend_flags)
|
||||
& WASM_SUSPEND_FLAG_EXIT)
|
||||
/* argv[0] isn't set after longjmp(1) to
|
||||
invoke_native_with_hw_bound_check */
|
||||
info_node->u.ret = exec_env->thread_ret_value;
|
||||
|
||||
Reference in New Issue
Block a user