vtk wasm threads

When compiling the code with PTHREADS or WASM_WORKERS enabled, I encountered an error stating “because it was not compiled with ‘atomics’ or ‘bulk-memory’ features.” How can I resolve this issue?

When wasm threads are enabled, all translation units must be compiled with those features. Configure and re-build VTK with -DCMAKE_CXX_FLAGS=-pthread.

Would this mean that the pthreads are used for vtkSMPTools?

Yes. The default STDThread backend works. TBB/OpenMP can be made to work by using pthread.

I’ll have some examples up soon.

1 Like

Two new examples were recently added in vtk/vtk#11386 to illustrate usage of threads in VTK.wasm

2 Likes