lua-users home
lua-l archive

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


On 04/01/2014 12:15 PM, Dominique Torette wrote:

Hi Thomas,

 

Thanks for the link to Lua 2013 workshop slides from Thomas Jericke (http://www.lua.org/wshop13/Jericke.pdf).

The solution explained starting from page 18 is close to what I tried (yield from a count debug hook).

But I’m not confident in such solution when your Lua programs also work with coroutines.

My idea is to suppress the coroutines support.

 

Thanks, Dominique Torette.

 

Yes this is true, you may not load the coroutines standard library to the interpreter. I certainly don't do that (and I also don't load the debug library either). Instead you may write your own API for the user to spawn coroutines and later synchronize them again.
I also introduced such things as mutex and sepmaphore, as they are needed as soon as you have pre-emption.
--
Thomas