[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: coroutines
- From: "Brent Arias" <barias@...>
- Date: Fri, 16 Sep 2005 15:17:11 -0700
>So, any idea's on where I can go from here?
I didn't look at your supplied output, but I had a somewhat similar problem
with Lua coroutines. I was able to create and execute 53 coroutines, and
then Lua would blow up. The problem was this: I was creating each coroutine
from inside of C++, which places the newly created coroutine onto the lua
stack, but I wasn't popping them off after I created them.
To solve the problem, after each coroutine creation I would immediately
transfer the coroutine from the stack into the LUAREGISTRY. That way, I
still had a reference to the coroutine (so it wouldn't be garbage
collected), and simultaneously I was no longer filling up my stack with
coroutines.
I can now spawn as many coroutines as I want.
-Brent