Skip to content

einarkristjan/wasm-shared-memory-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minimal example of how to compile a wasm module with shared memory enabled.

Included is a test that updates a variable as fast as possible in the shared memory, using a web worker (thread). The value of the variable is then displayed through the main thread.

As of writing, compiling the c code to WebAssembly worked with LLVM clang version 17.0.1.

To run the test in a browser, you will need a server with SharedArrayBuffers enabled.