From: lostgallifreyan <los...@gm...> - 2009-05-18 04:43:49
|
John Labenski <jla...@gm...> wrote: (17/05/2009 22:04) >I think it's a reasonable constraint that a coroutine cannot resume itself >since 1) it stays truer to Lua's behavior, 2) doesn't require second >guessing the user by swapping back to the main thread, which would be >unexpected to say the least, 3) the fix is simple, put any code that will >control a coroutine into the parent thread that created the coroutine where >it belongs. When I was looking at it I was wondering where and how I'd pass a returned value if I had to, which sort of fits with what you just said. I've never used a co-routine yet, but if I do, is it right to consider it purely as a sub-routine that happens to use a separate thread, and not to concern myself with the underlying methods that make it so? |