[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Re: Problem with concurrency, threads, Lua states and maybe GC?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 2 Dec 2009 17:08:03 -0200
> Consequently, I have changed the "dojump" macro in lvm.c to now be:
>
> #define dojump(L,pc,i) { (pc) += (i); luai_threadyield(); *base =
> L->base; *}
>
> /Now, I know that some "dojump" calls are also wrapped inside "Protect"
> and therefore the "base = L->base" is going to be duplicated in those
> cases. Of course, my optimising compiler removes the redundancy./
>
> Guess what - the problem has gone away and Lua is not failing its
> assertions anymore (and my Lua code isn't running off the rails)!!
>
>
> [...]
>
> Any thoughts or comments??
One possible culprit is the resize of stacks in the garbage collector.
In one phase of the garbage gollection, the collector may shrink
some stacks if they seem too big. So, I guess it may happen that the
collector running in one thread shrinks the stack of another thread.
(Of course that never crossed my mind until now..)
-- Roberto
- References:
- Problem with concurrency, threads, Lua states and maybe GC?, Matt 'Matic' (Lua)
- Re: Problem with concurrency, threads, Lua states and maybe GC?, Javier Guerra
- Re: Problem with concurrency, threads, Lua states and maybe GC?, Jerome Vuarand
- Re: Re: Problem with concurrency, threads, Lua states and maybe GC?, Matt 'Matic' (Lua)