A low-level Lua wrapper for pthreads and WIN32 threads that provides isolated Lua states in separate threads without shared memory.
lua-llthreads is a low-level Lua library that provides bindings to native threading APIs (pthreads and WIN32 threads), enabling true multithreaded programming in Lua. It creates isolated Lua states in separate threads without shared memory, solving Lua's traditional single-threaded limitation while maintaining thread safety through isolation.
Lua developers who need native multithreading capabilities for performance-critical applications, system programming, or integrating with existing threaded C libraries.
Developers choose lua-llthreads for its minimal, focused approach to threading that avoids complexity—it provides just enough to run Lua code in threads safely, forcing clean separation of concerns and encouraging message-passing architectures over shared state.
Low-Level threads(pthreads or WIN32 threads) 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.
Each thread runs in its own lua_State with no shared global state, ensuring thread safety by design, as emphasized in the project description and README.
Provides only essential functions for thread creation and management, avoiding bloat and adhering to a minimalist philosophy, which keeps the library lightweight and easy to reason about.
Data is passed to threads at creation and retrieved upon completion via join(), simplifying initial setup and reducing complexity, as demonstrated in the example usage.
Allows non-joinable threads for background tasks, offering flexibility in thread lifecycle management, a feature highlighted in the key features section.
Lacks mechanisms for data passing between running threads, forcing reliance on external libraries like ZeroMQ or sockets, which the README explicitly admits and recommends.
If join() is not called on joinable threads, the garbage collector may cause random pauses or freezes, as warned in the example, leading to potential resource leaks and unpredictable behavior.
For meaningful communication, additional libraries must be integrated, increasing project complexity and setup overhead beyond the core threading functionality.
Relies on pthreads for Unix and WIN32 threads for Windows, which can introduce portability issues or require platform-specific adjustments during installation and usage.