lua-users home
lua-l archive

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


On 02/24/2014 08:02 PM, Sean Conner wrote:
In Lua, there is no concept of a "parent/child coroutine."  If you want such
a concept, you'll have to wrap the coroutine routines to enforce this
"parent/child" concept.  In none of the codebases where I've used tons of
coroutines have I felt the need for a "parent/child" relationship.

When using my Lumen library, as tasks frequently create other auxiliary tasks and then might finish (or crash), keeping track of who created whom allows the scheduler to automatically kill those hanging tasks. This is optional, you can attach or detach tasks whenever you want. Typical use cases tasks connected by pipes doing protocol transformations, or tasks doing some managerial tasks like logging or such.

Jorge