[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Coroutines & C boundaries
- From: David Given <dg@...>
- Date: Wed, 15 Feb 2006 16:35:31 +0000
On Wednesday 15 February 2006 15:48, Mike Pall wrote:
[...]
> Nope. But there's Coco which is functionally the same for your
> purposes. I'll release an update to Coco whenever Lua 5.1 final
> is out. Mail me if you need a pre-release against 5.1-rc4.
The problem with Coco, though, is that because it's doing C stack swapping
it's an order of magnitude more difficult to make portable. Currently all my
code is generic and doesn't care what platform it's running on. With Coco, my
build system will have to know details about the platform configuration, etc.
The Resumable VM patch doesn't have any of this stuff, which I don't need
anyway.
> > I still don't know why this isn't working, either (it doesn't work on
> > vanilla 5.1rc either).
>
> IMHO it's better to find out the reason for this. It may point to
> a mistake in your program or a misunderstanding. The example you
> gave runs fine with a plain Lua script. My guess is that you are
> using pcall() or a callback from C code somewhere in a coroutine.
The only thing I can think of is that Gaim is somehow calling back into my
plugin while I'm running code from within my plugin. Which is evil.
Looking at the Lua code, I can't actually figure out how anything works in the
first place. In (Lua 5.0) lua_yield(), I get the boundary error if nCcalls>0.
But luaD_call() always increments nCcalls while doing the call, and as far as
I can tell, all cases where C is calling Lua pass through there; so how can
it ever *be* zero?
--
+- David Given --McQ-+ "It's the dawn of the day before the time of the
| dg@cowlark.com | land that the lost dinosaurs forgot to remember!"
| (dg@tao-group.com) | --- Ookla the Mok
+- www.cowlark.com --+
Attachment:
pgp63bs934lTE.pgp
Description: PGP signature