|
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.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.
I also introduced such things as mutex and sepmaphore, as they are needed as soon as you have pre-emption.
--
Thomas
C C C C C C C C C Coroutine created C C C C C C C B B C C B B B C C C C D C C C D D C C 4 5 6 C C B B C C B B B C C C C C A A C C C C C C C B C C B B C C B B C C C C C 1 2 3 C C D D D C C C C 4 5 6 B C C C B B B B C C C C C C