try icon indicating copy to clipboard operation
try copied to clipboard

Feature Request: Async support in Wasm dynamically compiled assemblies

Open juanfranblanco opened this issue 5 years ago • 1 comments

Description

When compiling / loading a program if it contains some await / async Task.Result / Task.Wait it will end up in a deadlock.

More complex scenarios need to run the code in the browser using wasm (together with compilation, but that is easily achieved already)

Reproduce the issue

On the editor here: https://dotnet.microsoft.com/platform/try-dotnet Type:

System.Threading.Tasks.Task.Delay(100).Wait();

Investigation / Experiments:

This is not specific to the WasmCodeRunner, you can also see the behaviour here: https://github.com/Suchiman/Runny, which is a simplified version of the WasmCodeRunner, loads the assembly and Invokes the assembly EntryPoint.

Other experiments, like loading on the current AppDomain do not help (trying to get the same scheduler) or alternatives like CsharpScripting (which does not resolve the assemblies for compilation in Wasm).

juanfranblanco avatar May 30 '19 10:05 juanfranblanco

This fixed in Suchiman Runny as follows: https://github.com/Suchiman/Runny/commit/6f4217804a2cac74d771f289bd113ccf41d597a8

juanfranblanco avatar May 31 '19 16:05 juanfranblanco