flecs-lua icon indicating copy to clipboard operation
flecs-lua copied to clipboard

Threading

Open randy408 opened this issue 3 years ago • 0 comments

Lua has a GIL which means calling into a VM from multiple threads will always result in locking. To get around this most threading implementation e.g. effil create their own OS threads with separate VM's.

Worker threads will have limitations e.g. require/ecs.import can't be used to reinitialize shared variables in a module because import functions are not idempotent, the modules have to be copied to/shared with the worker states.

Torch threads seem to be more efficient for this.

randy408 avatar Sep 12 '20 12:09 randy408