[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua and c interrupts (with lua callbacks)
- From: Kaos <kaos@...>
- Date: Thu, 27 Oct 2005 09:18:18 +0200
Sorry, forget one key info: I'm using Lua 5.0.2.
I'm experiencing some infrequent system hangs in my app, running mostly
It's an embedded application, where all the hardware functionality is
to lua, and all logic is running in lua with only glue parts running in c.
At some seemingly random points, the system however crashes, or hangs,
there's no reset nor a call to the lua panic function. Almost always during
a gc cycle (or close to it) though.
I'm wondering if I'm abusing the lua environment with the way I'm
the c interrupts from the hardware to lua, if that may cause problems.
Here's how I've done it.
There's a process running in c, calling a (or rather several, any one
registered) lua function periodically to have the lua code running.
And when there's a interrupt, or a c callback gets called, it will also
a lua function (in the same lua_State) although the c process might be
in the middle
of one of it's periodic calls.
My real question becomes: is this safe? I'm a bit wary this might not be..
But before I go down and tear all this up (that works nice, most of the
to do it with one single point to enter lua from c, I would like to hear
ideas/suggestions/thoughts from other lua practioneers!
Loads of Thanks in advance,