Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re^5: Pause and Resume Exe

by BrowserUk (Pope)
on Feb 28, 2013 at 12:10 UTC ( #1021045=note: print w/replies, xml ) Need Help??

in reply to Re^4: Pause and Resume Exe
in thread Pause and Resume Exe

Given that looks like this:

C:\test>type #! perl -slw use strict; use 5.010; say for 1 .. 1e6;

You can run that script using this script:

#! perl -slw use strict; use Win32::Process; Win32::Process::Create( my $hProc, '/perl64/bin/perl.exe', 'perl', 0, 0, '.' ) or die $^E; my $state = 1; while( <STDIN> ) { if( $state ) { $hProc->Suspend(); $state = 0; } else { $hProc->Resume(); $state = 1; } print "\nProcess is ", $state ? 'running' : 'suspended'; }

And each time you press enter on the command line, will be suspended or resumed.

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^6: Pause and Resume Exe
by gautamparimoo (Beadle) on Mar 01, 2013 at 05:41 UTC

    But again it keeps on waiting for some input from user as the process does not finish. It cmd running the process keeps on waiting. Why?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1021045]
[Discipulus]: ok a Perl one: how approach the task of getting all distinct paths from the edge to a node of a pascal triangle (nobackwards)?
[Discipulus]: each node has 2 descendants only: can i just compose hash keys usinng coords?
[karlgoethebier]: Discipulus: you shouldn't smoke turkish spices before noon
[Discipulus]: karl you says the same of my mom: in your place I'd been
[Discipulus]: preoccupied.. ;=)
Discipulus stopped with turkisk spices anyway.. but better hashes than arrays!
[oiskuu]: Discipulus, from the edge or from the top?

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2018-03-19 10:57 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (239 votes). Check out past polls.