LUA lanes

Lua Lanes is a Lua extension library providing the possibility to run multiple Lua states in parallel. It is intended to be used for optimizing performance on multicore CPU’s and to study ways to make Lua programs naturally parallel to begin with.

Why does not corona allow this? [import]uid: 108994 topic_id: 26629 reply_id: 326629[/import]

Out of curiosity, what is your specific use case?

While we aren’t directly opposed to this, it isn’t really a feature we are considering. Only certain types of operations (“embarrassingly parallel”) will benefit from something like Lanes. And it’s not clear that most users will understand these concepts. Also, the implementation of Lanes is pretty hardcore and the original author has moved on so it is not clear how we would support it. For instance, if we wanted to move to Lua 5.2, Lanes would be a blocking issue for the moment.

[import]uid: 7563 topic_id: 26629 reply_id: 107964[/import]

Thanks for the reply ewing,

I want to apologize concerning my knowledge of LUA lanes my information is based on looking for multi-threading in LUA. My multi-threading experience is primarily c, c++, and Java not LUA.

I am looking to grab / continuously pull network data on a thread, do statistical analysis on another and presentation on a third. [import]uid: 108994 topic_id: 26629 reply_id: 107979[/import]

Coroutines flat out don’t cut it. For example, what if you have a large sprite sheet you want to load, but while you are loading this you want to show an animation for a loading icon. This is impossible for coroutines because on a typical Android device, a large sprite sheet may take several seconds to load, or even more if it’s a multi-spritesheet. With coroutines, your animation just sits on the first frame while the loading happens on the same thread. With lanes, the loading could happen on a true background thread while your animation finished.

Loading spritesheets on the main thread and a separate lane thread could in theory nearly cut sprite loading time in half. [import]uid: 43795 topic_id: 26629 reply_id: 113581[/import]