lua-users home
lua-l archive

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

Are coroutines closed? They're created through lua_newthread(), but not closed with lua_close() right?

When you're finished with one, you just let it die and leave it alone, dangling inside lua, right?

Mike Pall wrote:


David Morris-Oliveros wrote:
It would be similar to the hooks in lua, but rather lua calling the hook every 5 instructions, i let it execute those 5 instructions, then it comes back to me.

That's inversion of control. Lua already supports that with the
help of coroutines. And lucky you, you can yield from a count hook
(or line hook).


// David Morris-Oliveros
// Camera & Lua Coder
// Team Bondi

Team Bondi Pty Ltd
Level 2, 608 Harris Street
Ultimo, NSW 2007
Tel: +61 (0)2 8218 1500
Fax: +61 (0)2 8218 1507
This email may contain confidential information.  If you are not
the intended recipient, you may not copy or deliver this message to
anyone. In such case, you should destroy this message and kindly
notify the sender by reply email. Opinions, conclusions and other
information in this message that do not relate to the official business
of our firm shall be understood as neither given nor endorsed by it.