[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Question regarding suspend/resume in Lua scripts
- From: "Dave Borgelt" <dborgelt@...>
- Date: Thu, 15 Jun 2000 12:33:46 -0400
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