lua-users home
lua-l archive

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


> -----Original Message-----
> From: lua-l-bounces@lists.lua.org [mailto:lua-l-bounces@lists.lua.org] On
> Behalf Of Ross Bencina
> Sent: vrijdag 29 maart 2013 4:59
> To: Lua mailing list
> Subject: Re: Lua and preemptive scheduling for coroutines
> 
> On 29/03/2013 2:35 PM, Tim Hill wrote:
> > You're not going to be able to pull that one off. The fundamental
> > structure of coroutines is different from threads, and nothing you do
> > can really change that (aside from a VERY significant reworking of the
> > Lua code base).
> 
> I don't know about that, all he's talking about is conditionally injecting
> yeild() into the code at arbitrary points (such as the end of each
> statement)
> 
> This could be done manually with a syntactic substitution. The question is
> whether it can be done using a debug hook or similar mechanism.
> 
> Ross.

I'm not sure if it can be done, but could you use the lock/unlock macros to perform the yield?

Thijs