[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Is it possible to run Lua threads in OS threads safely?
- From: Marc Balmer <marc@...>
- Date: Sun, 14 Jun 2020 12:56:20 +0200
I am adding https://github.com/arcapos/mqlua/ to the list of possibilities.
> Am 13.06.2020 um 23:24 schrieb Oliver <email@example.com>:
> On 13.06.20 20:16, Joseph C. Sible wrote:
>>> On Sat, Jun 13, 2020 at 2:05 PM James Pascoe <firstname.lastname@example.org> wrote:
>>> what I am trying to understand is whether it is possible to run individual Lua threads in separate OS threads safely?
>>> No, that's not possible to safely do with stock Lua. Different OS
>>> And also, is it possible for Lua threads running in separate OS threads to communicate?
>> On their own, separate Lua states can't communicate at all. You'd have
>> to use some kind of helper to communicate between them, like Lua Lanes
>>  or luaproc .
> you also might be interested to have a look at
> - lua-llthreads2  - Low-Level threads for Lua
> - mtmsg  - Low-level message buffers for inter-thread communication
> - mtstates  - Pass Lua states to other threads
> - mtint  - Make threads and coroutines interruptible
> These are orthogonal and low level cross platform packages that can be combined
> and play well together. IMHO they build a simple and minimal base for building
> higher level multi threading constructs in pure Lua.
> Best regards,
> : https://luarocks.org/modules/moteus/lua-llthreads2
> : https://luarocks.org/modules/osch/mtmsg
> : https://luarocks.org/modules/osch/mtstates
> : https://luarocks.org/modules/osch/mtint