Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Pause and Resume Exe

by BrowserUk (Patriarch)
on Feb 27, 2013 at 11:46 UTC ( [id://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.

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1020857]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2026-04-16 14:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.