Are there Asynchronous programming issues for Webgl?

This is very much scripting related - but also very much webgl related. So which forum?!
(FYI: I know very little about C# Tasks, async, await etc.!! I do understand multithreading can not be used for Unity objects)

There has been discussion on these boards on how webgl is single threaded and some standard C# threading commands may not work in webgl.
But I think I used plugins with the await task pattern already in webgl (see glTFast runtime model loading).

What effect does the webgl runtime have on these APIs?
Do things simply get blocked and run 1 by one instead of properly multi-threaded?

Is there a list of multi-threaded C# calls that cause real problems in webgl currently? (2022 LTS)

async/await works in WebGL just not with background Tasks

I’m not sure how it works, I suppose similar to coroutines where the task gets some time to execute/complete frequently. Would be interested to learn the details of that myself.

Practically anything in System.Threading with the exception of returning a Task object from async methods.
But for example Task.Delay() will either not work respectively block the main thread.

1 Like

Another (unity) plugin I have has ThreadPool.QueueUserWorkItem!! Gonna have to see if this fails or uses the main thread… Is there some documentation on this I am missing?