Unity Thread Safety

I understand that Unity is not thread-safe, but, surely there are parts of the library that are, actually, thread safe? Or no? Can we get a definitive answer on this, including which exact classes? Surely this is documented somewhere?

I’m thinking in particular about the more basic things like math and vector manipulation.

Any thread-safe Mono functions can be used in threads. The Unity API is generally not thread-safe and will generate an error at runtime if you try.

–Eric

And if you ever asked yourself why it is not thread safe despite being .NET: Reason is that it is not .NET. The Unity engine is pure native code.
.NET is only used as a scripting layer on top that talks to the lower layer, hence .NET stuff does not apply or not very well.

In case of the Unity API that means that anything that derives from UnityEngine.Object (aka all classes in its namespaces) are not to be touched by threads or even asyncronous callbacks from .NET / outside.
For vectors etc it shouldn’t be a problem as those are structs, not classes.

At a risk of beeing called a necrofiliack ;D(this seems to be the best place to do it).

Is there any chance for Unyty in a near future to be thread safe? With a new c# job system and stuff… will it be soon possible to manage or instantiate GameObjects from multiple threads?

Unity created the jobs system specifically as an alternative to traditional multithreading, which you should take as a hint they have no plans to work on both.