A concurrent programming library for Lua that enables parallel execution of Lua processes using message passing and POSIX threads.
luaproc is a concurrent programming library for Lua that enables parallel execution of Lua code through Lua processes and message passing. It solves the limitation of Lua's native coroutines, which cannot run in parallel, by using system threads (workers) and communication channels for inter-process communication.
Lua developers and researchers needing parallel processing capabilities in Lua applications, such as those building concurrent systems, simulations, or performance-sensitive scripts.
Developers choose luaproc because it provides a lightweight, message-passing concurrency model for Lua without shared data, reducing common concurrency issues like race conditions, while maintaining compatibility across Lua 5.1 to 5.3.
luaproc is a concurrent programming library for Lua
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses POSIX threads to run Lua processes in parallel, overcoming Lua's native coroutine limitation that prevents parallel execution, as stated in the introduction.
Implements the actor model with channels for communication, avoiding shared data and reducing race conditions, promoting safer concurrency as per the philosophy section.
Offers process recycling to reuse Lua states from finished processes, improving performance by reducing overhead, detailed in the recycling facility description.
Allows adjustment of active worker threads via setnumworkers, enabling management of system resource usage based on load, as described in the API.
Only atomic Lua values (strings, numbers, booleans, nil) can be sent directly; complex types require encoding, adding overhead and complexity, as admitted in the message passing section.
Sends are always synchronous, blocking processes until received, which can lead to performance issues and deadlocks if not carefully designed, per the API for luaproc.send.
Channels must be explicitly created and destroyed, increasing boilerplate code and risk of errors like using destroyed channels, as noted in the channel management functions.