You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most UniTask methods run on a single thread (PlayerLoop), with only UniTask.Run(Task.Run equivalent) and UniTask.SwitchToThreadPool running on a thread pool. If you use a thread pool, it won't work with WebGL and so on.
UniTask.Run is now deprecated. You can use UniTask.RunOnThreadPool instead. And also consider whether you can use UniTask.Create or UniTask.Void.
Beyond the WebGL platform considerations, what difference does it make to run a UniTask on the Unity thread vs on the thread pool?
I though the goal of using UniTask over C# Task was to embrace the single threaded nature of Unity and making the most of it, but this part confuses me.
Can anyone enlightenment me especially on the consequences of not running on the Unity thread?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey, I don't understand...
The documentation says:
Beyond the WebGL platform considerations, what difference does it make to run a UniTask on the Unity thread vs on the thread pool?
I though the goal of using UniTask over C# Task was to embrace the single threaded nature of Unity and making the most of it, but this part confuses me.
Can anyone enlightenment me especially on the consequences of not running on the Unity thread?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions