Commit Graph

5 Commits

Author SHA1 Message Date
Crypt Keeper
cde7ce6e4a Refactors concurrent close tests (#411)
Signed-off-by: Adrian Cole <adrian@tetrate.io>
2022-03-26 15:01:47 +08:00
Takeshi Yoneda
ab2b737df1 Adds Module.Close API based on runtime.Finalizer (#360)
This commit adds Module.Close API, which can be used to indicate that
the module will no longer be used and setting finalizers for the allocated
resources. Notably, this will set finalizers on compiledFunction to deallocate
mapped memory regions as well as removing them from the store-wide
storage. As a result, users can re-instantiate a module for the same name
while having the safety -- Calling Module.Close is safe even when there are
outstanding function calls as we never explicitly deallocate but indirectly
do that via Goruntine's finalizers.

resolves: #293

Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-03-14 10:35:27 +09:00
Takeshi Yoneda
eca589bac5 Removes unrepresentative cases from adhoc (#358)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-03-11 10:29:05 +09:00
Takeshi Yoneda
336ebcf436 Enable concurrent instantiation, and release (#342)
This makes sure that concurrent use of Instantiate and
ReleaseModuleInstance is goroutine-safe.

Note that it is still not safe to expose Release in the public API
as we haven't taken into account the outstanding calls. That
would be addressed in the follow-up commit.

Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
Co-authored-by: Adrian Cole <adrian@tetrate.io>
2022-03-07 21:05:32 +09:00
Takeshi Yoneda
82aec51eb9 Adds tests for multiple goroutines (#331)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-03-04 18:19:26 +09:00