Solarus-Games English Forum

Solarus => Development => Topic started by: mattias on April 11, 2015, 03:17:37 PM

Title: Concurrency
Post by: mattias on April 11, 2015, 03:17:37 PM
I'd like my timer scripts to avoid race conditions, but I haven't been able to find any definitive information about how lua scripts are run by the Solarus engine.

Can there be more than one thread running at any one time? Are threads ever pre-empted?
Title: Re: Concurrency
Post by: Christopho on April 12, 2015, 08:04:38 PM
All Lua scripts run is the same thread. If several timers expires in at same cycle, I think the first one created is treated first.