coroutine
What are Lua coroutines even for? Why doesn't this code work as I expect it?
I\'m having trouble understanding this code... I was expecting something similar to threading where I would get an output with random \"nooo\" and \"yaaaay\"s interspersed with each other as they both[详细]
2023-02-14 03:21 分类:问答Should lua_resume always have a balancing lua_yield?
I have a C-based API exposed to lua that schedules lua coroutines based on triggers in the game engine.[详细]
2023-02-14 02:52 分类:问答Coroutine vs Event driven programming
Regarding the example in wikipedia: http://en.wikipedia.org/wiki/Coroutine var q := new queue coroutine produce[详细]
2023-02-10 00:37 分类:问答ucontext across threads
Are contexts (the objects manip开发者_开发技巧ulated by functions in ucontext.h) allowed to be shared across threads? That is, can I swapcontext with the second argument being a context created in mak[详细]
2023-01-31 03:45 分类:问答Coroutine demo source /2
Can somebody explain why this code doesn\'t work on codepad? A modified version (with virtual function) actually works though -[详细]
2023-01-28 16:22 分类:问答What's the advantage of stack-less Python's microthread than Lua's coroutine in state machine implementation for game?
Any advantage on stack-less python implen开发者_JAVA百科tation than Lua\'s coroutine? What\'s the difference of them?stackless python and tasklets (I haven\'t done any programming with stackless pytho[详细]
2023-01-23 09:26 分类:问答Abandoning coroutines
How bad is it in Lua 5.1 to never let a coroutine properly end? In other words, if a coroutine yields开发者_运维问答 but I never resume it, does it leave a lot of state lying around until program comp[详细]
2023-01-14 05:25 分类:问答Is there a safe way to use setjmp() and longjmp() in C++?
I was under the impression that using setjmp() and longjmp() in C++ was almost guaranteed to mess up the stack, since these functions don\'t perform unwinding like, say, exceptions do. This MSDN page,[详细]
2023-01-11 07:11 分类:问答Why doesn't this simple Lua coroutine work?
I have a very simple little piece of Lua code, which I wrote while teaching myself how coroutines work.[详细]
2023-01-05 19:24 分类:问答How can I create a parallel stack and run a coroutine on it?
I decided I should try to implement coroutines (I think that\'s how I should call them) for fun and profits. I expect to have to use assembler, and probably some C if I want to make this actually usef[详细]
2023-01-04 12:03 分类:问答