add spawn thread API and sample (#333)

This commit is contained in:
Xu Jun
2020-08-04 17:40:45 +08:00
committed by GitHub
parent ed8ddb2cea
commit 2db335c6d4
11 changed files with 591 additions and 7 deletions

View File

@ -116,7 +116,7 @@ The default value of N is 4, which means you can create 4 threads at most. This
``` bash
./iwasm --max-threads=n test.wasm
```
If you are going to develop your own runtime product, you can use the API `wasm_runtime_set_max_thread_num` to set the value, or you can change the macro `CLUSTER_MAX_THREAD_NUM` in [config.h](../core/config.h),
If you are going to develop your own runtime product, you can use the API `wasm_runtime_set_max_thread_num` or init arg `init_args.max_thread_num` to set the value, or you can change the macro `CLUSTER_MAX_THREAD_NUM` in [config.h](../core/config.h).
> Note: the total size of aux stack reserved by compiler can be set with `-z stack-size` option during compilation. If you need to create more threads, please set a larger value, otherwise it is easy to cause aux stack overflow.