Topic was automatically imported from the old Question2Answer platform.
Asked By
zeruno
I am creating a Singleton (Autoload) as in this official documentation. I am creating a scoreboard and tracking the number of enemies killed. Whenever an enemy is killed, the scoreboard value is incremented. Is this implementation prone to race conditions, does Godot provide thread-safety here? Or should I take additional precautions?
Global Scope singletons are all thread-safe. Accessing servers from threads is supported (for VisualServer and Physics servers, ensure threaded or thread-safe operation is enabled in the project settings!).