lua-users home
lua-l archive

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


I have what is probably an odd need and I cannot see how to resolve it using
Lua, but I'm hoping there is a way.

I am trying to use Lua as a scripting language for an external program.
This embedding program is not written in C but I am able to use the C
language interface to call Lua scripts.  This is working fine except when
the Lua scripts are long running and this causes my calling system to block
and become unusable for the duration.  The embedding program is single
threaded at the OS level and so it blocks during the call to the Lua dynamic
library.

What I would like to be able to do is create a function (maybe with the
Debug library if I must) which could be used to 'return' to the calling
program at intervals.  This I would put into any long running Lua functions
intermittently.

The calling program could be altered to send any appropriate call to Lua to
'resume' the currently suspended Lua program after it has had a bit of time
to run.

I hope this is clear.  Thank you for any help or advice.

Dave