in reply to Re^5: Win32::Job::watch vs. system(1,...)
in thread Win32::Job::watch vs. system(1,...)

my $pid = $job->spawn();

I must admit that there is something I don't understand in the documentation of Win32::Job::spawn. The perldoc says:

spawn($exe, $args, \%opts); Creates a new process and associates it with the Job. The proc +ess is initially suspended, and can be resumed with one of the other methods.
I was thinking that this means, spawn creates a new process, but does not actually execute it, and that I would have to execute it with one of the other methods (run or watch). In your example, you use neither of these. How is this supposed to work, respectively, in what way did I misunderstand the documentation?

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^7: Win32::Job::watch vs. system(1,...)
by BrowserUk (Patriarch) on Sep 28, 2009 at 10:44 UTC

    Okay. Looking back at the code on my archive CD from my old machine, the one time I had occasion to use Win32::Job, I encountered the same problem and fixed it by adding these 5 lines to Job.xs:

    void run_nw(self) JOB_T self CODE: resume_threads(aTHX_ self->procs );

    If you add that and rebuild, you can start the job asynchronously by calling $job->run_nw when you've set the job up.

    Sorry for not putting two and two together from your earlier posts ... um, earlier.


    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.