Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Pause and Resume Exe

by BrowserUk (Pope)
on Feb 27, 2013 at 11:46 UTC ( #1020857=note: print w/ replies, xml ) Need Help??


in reply to Pause and Resume Exe

Maintain a second exe which calls some function to pause the state of the main exe

See Win32::Process. Use it in the second script to start the first script. It has Suspend() and Resume() methods you can use on the process you start using it.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re: Pause and Resume Exe
Re^2: Pause and Resume Exe
by gautamparimoo (Beadle) on Feb 27, 2013 at 11:56 UTC

    But I have to specify in the beginning only when to suspend and resume the exe. Nothing can be given while script is already running

      But I have to specify in the beginning only when to suspend and resume the exe.

      No you don't.

      Script A uses Win32::Process::CreateProcess() to start perl.exe running script B. It gets a process handle back from that call.

      Script B is running asynchronously from Script A. And Script A can call $hproc->Suspend() and $hproc->Resume() whenever it chooses to.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

        @BrowserUK . Plz elaborate how can tell the script A to suspend through script B(I cannot hardcode in script B to suspend for some time as that would be known only at runtime)and then resume again?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1020857]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (11)
As of 2014-07-25 12:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (171 votes), past polls