I install wasm in DFX occure thread and shared memory issue.
The returned message is as following:
:~/icp/examples/fio$ dfx canister install fio
Installing code for canister fio, with canister_id rrkah-fqaaa-aaaaa-aaaaq-cai
The invocation to the wallet call forward method failed with the error: An error happened during the call: 5:
Wasm module of canister rrkah-fqaaa-aaaaa-aaaaq-cai is not valid: Wasmtime failed to validate wasm module wasmtime::Module::validate() failed with threads support is not enabled (at offset 17632)
Another Error:
$ dfx canister install decoder
Installing code for canister decoder, with canister_id rrkah-fqaaa-aaaaa-aaaaq-cai
The invocation to the wallet call forward method failed with the error: An error happened during the call: 5:
Wasm module of canister rrkah-fqaaa-aaaaa-aaaaq-cai is not valid: Wasmtime failed to validate wasm module wasmtime::Module::validate() failed with threads must be enabled for shared memories (at offset 2342)
Threads and shared memory have not yet been officially adopted by the Wasm standard, and hence are not supported on the IC.
Furthermore, it is not clear whether they can ever be supported on the IC, since the non-determinism inherent to proper threads is fundamentally incompatible with deterministic execution as needed for consensus on a block chain.
Not in a way that would even be remotely efficient. Threads are all about fast shared-memory concurrency, whereas canisters provide shared-nothing concurrency. Emulating shared memory with messaging would be so slow that it would defeat the purpose. Among many other problems.
Since IC canister is single-threaded, if a canister needs a huge mount of computing resources, how can a single canister maximize the use of a large number of CPUs on the IC network?
The IC may execute multiple canisters in different threads when it can (though I don’t think it’s doing that yet). So you could potentially use multiple canisters for parallelisation. But you have to live with this being shared-nothing concurrency.
So compared to a conventional OS, you only have multiple processes but not multiple threads.
In general, I’d say that the IC is not the platform you want to do heavy number crunching on, at least not for the time being. The per-message cycle limit alone makes that difficult at the moment. And replication makes it pretty wasteful, too.