Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Does Unity render on the same thread as Update?

Discussion in 'Scripting' started by iMakeMehGames, Nov 23, 2023.

  1. iMakeMehGames

    iMakeMehGames

    Joined:
    Jul 29, 2021
    Posts:
    3
    Pretty much the title; does unity render the scene (on the cpu side) on the same thread as Update? I want to know so that I can offload my complex operations to a different thread.
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,066
    The answer is: yes, to some degree. Details: unknown. This is pretty much irrelevant though.

    Note that most of Unity's regular API is not thread safe and will not work (correctly) on background threads.
    For multithreading in Unity use the Job system. Thanks to the Burst compiler it's also leaps and bounds faster than any standard C# multithreaded code.
     
    Bunny83 and Ryiah like this.
  3. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,292