lua-users home
lua-l archive

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


Mike Pall wrote:
From jitdoc/coco_portability.html:

Note for Windows: Please read the explanation for the default
Thread Stack Size
  http://msdn.microsoft.com/library/en-us/dllproc/base/thread_stack_size.asp
in case you want to create large numbers of Fiber-based
coroutines.

Ah, okay.  Thing is, I'm not sure that I do want to create a
large number of Fibre-based coroutines, but I guess these
sorts of things can temporarily happen anyway when you have
some recursive iterators crawling a widget tree, etc.

I suspected it was a stack thing and did try halving the
windows stack size, but the program still burst.  I didn't
dare go lower because another third-party library I use
can be REALLY stack-hungry.

Fortunately my codebase is COCO_DISABLE-safe already for
other sad reasons that Mike already knows so this isn't
a big deal for me (hey, maybe it's even a good thing,
since it gives me platform parity :) ).

One thought: before panicking with an OOM when presumably
trying to create a fibre, could LuaJIT do a big aggressive
GC to try to collect any abandoned coroutines?  If the
problem here is throwaway iterators jamming up the reserved
address space (this seems reasonably likely since these are
all I use coroutines for in the problematic app) then this
may save the day.  Dunno if this is easy or worth the bother.

Cheers,
--Adam