Are callbacks run in parallel?
I have an array that I modify in the OnUpdate handler. Somewhere else in the code, I call the method C_Timer.After, altering that same array after N milliseconds.
Here's my question: Will the callback run in parallel with OnUpdate, and thus risking both methods changing the array at the same time? Or does it run sequentially? |
Lua is a single thread language, so going without testing, I'd say sequential.
|
The entire Lua engine is in a single thread run by the renderer. While the coroutine library does offer thread-like functionality, it's not async. This means it blocks execution of the caller until it yields, pausing its own execution until it's called again.
|
All times are GMT -6. The time now is 03:24 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI