Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Pause and Resume Exe

by sundialsvc4 (Monsignor)
on Feb 27, 2013 at 13:02 UTC ( #1020881=note: print w/ replies, xml ) Need Help??


in reply to Pause and Resume Exe

Actually, that won’t work as intended, because the program will sto .. dle of whatever was do .. the time, not at an appropriat .. ping point.

The process will need to be processing Windows messages timely, in addition to doing what it’s regularly doing, which pretty much calls for a secondary thread to do the work while the primary thread listens for mouse-moves and keystrokes.   When a stop-signal is received, a shared flag needs to be raised which the other thread continually checks at appropriate times, whatever “appropriate” may mean to this procedure.   Then, it must suspend itself without busy-waiting or timing holes.   Not trivial.

By “appropriate,” I mean for example, “stop after processing the file that you are currently processing.”   Flipping the main power switch on-and-off won’t do that.


Comment on Re: Pause and Resume Exe
Re^2: Pause and Resume Exe
by BrowserUk (Pope) on Feb 27, 2013 at 13:17 UTC
    The process will need to be processing Windows messages timely, in addition to doing what itís regularly doing, which pretty much calls for a secondary thread to do the work while the primary thread listens for mouse-moves and keystrokes.

    Yet more crap!

    Any windows process can be suspended and resumed. And when it is resumed, it will carry on from where it left of with no knowledge it was ever suspended.

    If it is a gui process, its screen will not respond to input while it is suspended. But a) there is no suggestion in the OP that this is a gui program; b) so what if it is.

    By way of demonstration, I suspended my browser after typing that last paragraph and the resumed it a couple of minutes later to type this one. And ``""'**NOTHING BAD HAPPENED!**'""''


    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.
Re^2: Pause and Resume Exe
by Anonymous Monk on Feb 27, 2013 at 16:05 UTC

    Seems to me you need to state your assumptions and conditions on those problems.

    However, your first sentence-example is just wrong. The program will pick up exactly where it left off, not skip ahead after the resume. It is just like having a very slow CPU for a while... as long as there isn't a wallclock dependency, it will be fine.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2014-09-18 06:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (108 votes), past polls