SGTK/Tank core - thread safe?

This is an easy question that I couldn’t find the answer to in the docs. Is the Tank core object created through sgtk_from_path() or sgtk_from_entity() thread-safe, or do we have to handle thread safety in our code? I noticed that the sgtk.shotgun object is listed as wrapped to be thread-safe, so I’m assuming that means the tank is as well.

Thanks!

4 Likes

Good question, not sure! Going to check with the Toolkit team and find out.

1 Like

Hi (again!) @tk421storm

There is no guarantee of thread-safety with the Toolkit API outside of the shotgun object.

The vast majority of the time, people are calling Toolkit code from the UI, so it hasn’t proven necessary, but if you do want to do some parallel work, you may want to leverage the background task manager.

Hope that helps! Let us know if you have any other questions.

4 Likes

Thank you Tannaz! That makes sense to me.

2 Likes