Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct here to familiarize yourself with the rules and how to post constructively.

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice
  3. Improve your project's performance with our new guide on profiling in Unity.
    Dismiss Notice

Unity threads

Discussion in 'Editor & General Support' started by Omar Rojo, Feb 9, 2009.

  1. Omar Rojo

    Omar Rojo

    Joined:
    Jan 4, 2007
    Posts:
    494
    I was wondering how many threads a Unity application has ?

    And what about coroutines ? are keep in the same thread ?

    What could be a situation in where more than one thread could be present at the same time in the same app run ?

    .org
     
  2. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    All your script functions (including coroutines) are executed on the same thread.

    If you want to manually use more threads, you can do that (create .NET threads), but be aware that Unity API is not thread safe.
     
  3. Omar Rojo

    Omar Rojo

    Joined:
    Jan 4, 2007
    Posts:
    494
    Thanks Aras

    Its exactly the answer i was expecting

    .org
     
unityunity