lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello list,

I would like to announce 3 new packages "mtmsg", "mtstates" & "mtint" implementing basic low-level functionality that can be used to build higher-level multi-threading constructs.

Each of these packages can be used independently in arbitrary multi-threading scenarios and does not depend on a concrete multi-threading implementation (the examples in the documentation are using "lua-llthreads2 - Low-Level threads" as multi-threading implementation, see: https://luarocks.org/modules/moteus/lua-llthreads2).

mtmsg: provides low-level in-memory message buffers for inter-thread communication, see: https://github.com/osch/lua-mtmsg#mtmsg

mtstates: provides a way to create new Lua states from within Lua for using them in arbitrary threads. This can be useful in a thread-pool scenario when there is a number of heavy-weight Lua states and method invocations on these states should be distributed over a restricted number of hardware threads, see: https://github.com/osch/lua-mtstates#mtstates

mtint: provides a way to make arbitrary Lua interpreter states (i.e. main states and couroutines) interruptible from concurrently running threads. This can be useful for applications with interactive user interface when a user wants to abort a long running background task or a user supplied script that is stuck in an infinite loop, see: https://github.com/osch/lua-mtint#mtint

Each of these packages runs under Lua 5.1, 5.2, 5.3, luajit 2.0 & 2.1 (only "mtint" has some restrictions for Lua 5.1 & luajit) and has been tested to run under Linux, Windows & MacOS. Other operating systems could be possible (currently the implementation can use: gcc atomic builtins, C11 stdatomic.h, pthread.h, C11 threads.h and Win32-API).

All packages are available via LuaRocks.

Best regards,
Oliver