flecs-hub/flecs-lua

How are lua systems forced to run on the main thread?

sro5h opened this issue · 1 comments

sro5h commented

I saw that in system.c there is an assert to make sure that lua systems are run on the main thread:

ecs_assert(stage_id == 0, ECS_INTERNAL_ERROR, "Lua callbacks must run on the main thread");

But i can't find any code that actually disables multithreading while initializing lua systems or for the world as a whole. Am i missing something?

For v3 there is a new ecs_system_desc_t.multi_threaded, it's initialized to 0 (i.e. false) by default, that's why you don't see any specific code for that.

That assert is from the v2 days where you either disabled threading or scheduled the systems on your own, there was no per-system scheduling option.