Is there a way to create, program, and run a seperate threads using LUA in APMS?
Professional Software Development Tools
Is there a way to create, program, and run a seperate threads using LUA in APMS?
Never know what life is gonna throw at you.
(Based on a true story.)
Although Lua does not have true multithreading, it does support "coroutines":
http://www.lua.org/manual/5.0/manual.html#2.10
I've read about them, however, I'm searching for something similar to On Timer event...
So that part of my code can run concurrently with the chunk of code which calls it.
Never know what life is gonna throw at you.
(Based on a true story.)
You could make the coroutine yield and resume on the timer... never tried it but a possibility.
I thought about that actually... will try it once!Originally Posted by Brett
Never know what life is gonna throw at you.
(Based on a true story.)
Here is a link to a tutorial for coroutines from the lua-users page
http://lua-users.org/wiki/CoroutinesTutorial
Tigg
TJ-Tigger
"A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
"Draco dormiens nunquam titillandus."
Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine