lua-users home
lua-l archive

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


R. Lake wrote:

> The multiple concurrency would also be put at risk if the Lua
> script included something like:
> 
> table.foreach(table_with_a_million_keys, some_long_computation)

Hmm. Looks like I'll have to nil all library functions that use lua_call
to prevent their use. A pity, they tend to be the more useful ones :-(.

> > Yielding from the line count hook should be useful for stepping
> > through a Lua program with a synchronous update of some
> > source code display on the C side.

> I thought about that but the limitations on yielding hooks seem too
> extreme for a debugger. Anyway, you could just do the synchronous
> update without the yield, though, couldn't you?

Uhm, yes you're right, on the C side you could. But not on the "A" side.

> But what would this restrictive "A" language be, I wonder?

The technique should work for any language that can call but cannot
be called by C but my particular application involves embedding and
extending Lua with LabVIEW (aka G), a compiled graphical dataflow
language (see http://www.ni.com) that is the tool of choice in the data
acquisition / test and measurement world.

> Have you actually tried this code?

Yes. Under 5.0 beta, still. Performance is roughly one yield+resume
call per 200 Lua opcodes (35000 calls/s at 4-10M opcodes/s, on a
600MHz PIII).