Modding Discussion Concurrency in world update processing?

Discussion in 'Starbound Modding' started by rl.starbound, Jan 23, 2023.

  1. rl.starbound

    rl.starbound Phantasmal Quasar

    Reading various online sources leads me to believe that Starbound's world object processing occurs in a single thread, but I'm having a hard time finding documentation specifically covering that. Does anyone know definitively (preferably with documentation to back it up) whether multiple objects within a single world can have their script contexts execute concurrently?

    More concretely, I'm implementing a new object that reads and updates a world property. There could be more than one of these objects in use on a world, but all reading and updating the same property. If all of the objects' script contexts in a given world run in a single thread of execution, then it's simple to write getProperty/setProperty code that works correctly. If, however, it's possible that two or more objects in a given world might have their script contexts run concurrently on different threads, then I'd have to implement some synchronization locking code.

    Looking at the vanilla assets, I don't see anything obviously involving locks, synchronization, or mutexes, so I'm guessing that things are probably single threaded within a world, but I wanted to double-check for anything authoritative.
     

Share This Page