Skip to content

permutationlock/zig_emscripten_threads

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zig threads in Emscripten

A toy example showing Zig threads working in the browser with Emscripten.

Currently requires the standard library patch #19287. Also, there are issues with allocators in Emscripten release builds when not using the emcc flag -s USE_OFFSET_CONVERTER, see here.

A go webserver is provided to host the Emscripten app with cross-origin isolation turned on. Threading in Emscripten uses the experimental shared memory browser features which can only run in pages with cross-origin isolation.

To build and host the application:

zig build --sysroot [emsdk]/upstream/emscripten
go run server.go

Then go to http://127.0.0.1:8083 in a browser to hopefully see the printout and no console errors.

About

A toy example showing Zig threads working in Emscripten

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages