I am get stuck in a performance issue in unity Webgl that whenever my asset bundles are load the unity game get freez for some seconds/mins. I know that unity is not thread safe and it is based on single thread but these statements are confusing for me form the official sites/persons of unity:
Lack of threading support in JS ? do it means it support on desktop?
Since WebGL does not support threading, and since http downloads will only become available when finished, Unity WebGL builds need to decompress AssetBundle data on the main thread when the download is done, thus blocking the main thread. To avoid this interruption, you may want to avoid using the default LZMA Format for your AssetBundles, and compress using LZ4 instead, which is decompressed very efficiently on-demand. If you need smaller compression sizes then LZ4 delivers, you can configure your web server to gzip-compress the files on the http protocol level (on top of LZ4 compression) (Source Unity Forum/Offical 2).
Here is saying doesn't support threading but asset bundle is load in the main thread? Do it support thread? It sounds confusing for me.
WebGL does not support threads, so the Async operation is running on the main thread causing the freeze that you are seeing (Source Unity Forum/offical). Blockquote
Doesn't support thread but asset bundle loading in main thread??
These all statements are confusing for me? Do unity supports thread ? if No then What is main thread? Why unity repeteadly call that asset bundle are load in main thread? If unity don't support thread then how asyc/coroutine operation are performed?
Edit: Unity 2019.1 has released with this note WebGL: Added experimental multi-threading support. Do it means we can use thread now?