{"version":"1.0","type":"rich","title":"Safe flag test (emscripten)","description":"This example demonstrates a safe-flag test for WebAssembly threads, showing atomic boolean operations across thread creation and joins. The program stores and loads a boolean with `memory_order_release` and `memory_order_acquire` semantics, printing its value from both the main thread and a spawned thread. It builds with SCons using the Emscripten toolchain, enabling pthreads via `-sUSE_PTHREADS=1` and shared memory, while the C++17 code relies on `std::atomic_bool` and `std::thread`. The visualization compiles to `index.html`, `index.js`, and `index.wasm` for browser execution.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-b6f06d378bdd299f1369c8fa4723da0e?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}