> if it has race conditions
Does this mean starlark cannot generate a race condition? If so, how does threading work?
> if it has race conditions
Does this mean starlark cannot generate a race condition? If so, how does threading work?
Basic answer: there is no threading, at least not for the user.
The build system runs a thread per BUILD file (in bazel). Since the BUILD files are written in starlark and starlark has no threads -- there is no problem.
Bazel is massively parallel. It has to evaluate a potentially large number of BUILD files; each file can have multiple load statements. You end up with a graph of dependencies and Bazel will evaluate as many files as possible in parallel.
In short: Evaluating a file has no visible side-effect. The evaluation returns a set of frozen values. These values that can accessed by other threads become immutable.