AssemblyScript / examples

A collection of AssemblyScript examples.
https://assemblyscript.org
MIT License
287 stars 50 forks source link

add nodejs and AssemblyScript memory share demo #26

Closed JesseCodeBones closed 2 years ago

JesseCodeBones commented 2 years ago

I created a simple demo for AS Shared memory with Nodejs, please kindly verify if it is suitable to show this demo. If it is not suitable, please feel free to decline this PR. Regards

MaxGraey commented 2 years ago

Thanks for efforts! But this example is very basic and doesn't show how to use multithreading with the shared memory from AssemblyScript side. In addition, it contains a lot of mistakes. In general, multithreading on AS isn't yet ready for, because the memory manager is not thread safe, and mutable shared globals should be stored in linear shared memory (at least for "atomic" globals). For now all globals stored as thread local global variables by default. So closing this for now