Lua :: How to write simple program that will load multiple CPUs?

后端 未结 6 560
猫巷女王i
猫巷女王i 2021-02-07 17:27

I haven\'t been able to write a program in Lua that will load more than one CPU. Since Lua supports the concept via coroutines, I believe it\'s achievable.

Reason for me

6条回答
  •  北海茫月
    2021-02-07 18:07

    It is not possible with the core Lua libraries (if you don't count creating multiple processes and communicating via input/output), but I think there are Lua bindings for different threading libraries out there.

    The answer from jpjacobs to one of the related questions links to LuaLanes, which seems to be a multi-threading library. (I have no experience, though.)

    If you embed Lua in an application, you will usually want to have the multithreading somehow linked to your applications multithreading.

提交回复
热议问题