multithreading - Lua execute several tasks at once -


i have been looking solution execute several task (atleast 2) simultaneously. found coroutines in lua. can please clarify me in detail how handle 2 or more 1 task? trying run execute event , measure memory consumption process using lua script. quick solution or ideas highly appreciated. thanks

take io.popen(prog [, mode]).

from the documentation io.popen, "starts prog in other process".

here how implement this:

-- launch prog want measure. assume not quit immediately. -- lua not block here: not wait prog exit. io.popen('script-you-want-to-measure')  -- launch second process measure first. local measure = io.popen('measuring-process', 'r')  -- read block until measure program exits local measure_output = measure:read('*a') f:close()  -- want output 

Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -