{"id":20332475,"url":"https://github.com/permutationlock/zig_emscripten_threads","last_synced_at":"2025-09-23T02:31:58.367Z","repository":{"id":196047807,"uuid":"694189797","full_name":"permutationlock/zig_emscripten_threads","owner":"permutationlock","description":"A toy example showing Zig threads working in Emscripten","archived":false,"fork":false,"pushed_at":"2024-10-03T05:42:38.000Z","size":7,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-14T20:30:16.025Z","etag":null,"topics":["emscripten","threads","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/permutationlock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-20T13:59:14.000Z","updated_at":"2024-10-03T05:42:42.000Z","dependencies_parsed_at":"2024-11-14T20:38:59.969Z","dependency_job_id":null,"html_url":"https://github.com/permutationlock/zig_emscripten_threads","commit_stats":null,"previous_names":["permutationlock/zig_emscripten_threads"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permutationlock%2Fzig_emscripten_threads","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permutationlock%2Fzig_emscripten_threads/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permutationlock%2Fzig_emscripten_threads/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permutationlock%2Fzig_emscripten_threads/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/permutationlock","download_url":"https://codeload.github.com/permutationlock/zig_emscripten_threads/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233915670,"owners_count":18750264,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emscripten","threads","zig"],"created_at":"2024-11-14T20:26:49.307Z","updated_at":"2025-09-23T02:31:53.276Z","avatar_url":"https://github.com/permutationlock.png","language":"Zig","readme":"# Zig threads in Emscripten\n\nA toy example showing Zig threads working in the browser with Emscripten.\n\nCurrently requires the standard library patch [#19287](https://github.com/ziglang/zig/pull/19287). Also, there are issues with allocators in Emscripten release builds when not using\nthe `emcc` flag `-s USE_OFFSET_CONVERTER`, see [here](https://ziggit.dev/t/state-of-concurrency-support-on-wasm32-freestanding/1465/9?u=permutationlock).\n\nA go webserver is provided to host the Emscripten app with cross-origin\nisolation turned on. Threading in Emscripten uses the experimental shared memory\nbrowser features which can only run in pages with cross-origin isolation.\n\nTo build and host the application:\n\n```Shell\nzig build --sysroot [emsdk]/upstream/emscripten\ngo run server.go\n```\n\nThen go to [http://127.0.0.1:8083](http://127.0.0.1:8083) in a browser to\nhopefully see the printout and no console errors.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermutationlock%2Fzig_emscripten_threads","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpermutationlock%2Fzig_emscripten_threads","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermutationlock%2Fzig_emscripten_threads/lists"}