Lua Lanes is a Lua extension library providing the possibility to run multiple Lua states in parallel.
Lua Lanes is one of several multithreading libraries for the Lua scripting language. It allows creation of OS threads and passing Lua functions and data between these. Locking is automatic so writing of multithreaded code should be relatively easy.
Use this tag for questions explicitly referring to Lanes. For general questions on Lua multithreading, use tags s.a. lua and multithreading (maybe along with lua-lanes).
Lanes is included into your software by the regular require "lanes"
method. No C side programming is needed; all APIs are Lua side, and most existing extension modules should work seamlessly together with the multiple lanes. It can be ownloaded from its official git-page.
Lua Lanes features:
- Lanes have separated data, by default. Shared data is possible with Linda objects.
- Communications is separate of threads, using Linda objects.
- Data passing uses fast inter-state copies (no serialization required)
- "Deep userdata" concept, for sharing userdata over multiple lanes
Limitations:
- coroutines are not passed between states
- sharing full userdata between states needs special C side preparations (-> deep userdata)
- network level parallelism not included