Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: How to portably stop processes?

by NERDVANA (Deacon)
on Mar 31, 2023 at 17:13 UTC ( #11151385=note: print w/replies, xml ) Need Help??

in reply to How to portably stop processes?

Actually fork and exec don't "work fine" on Windows :-( They're cheap approximations that have all sorts of bad consequences for programs written in a Unix mindset. You can read about it on Proc::Background::Win32

That module is also my recommendation for how to handle your problem. (disclaimer: I'm the maintainer) (and bah, there's a POD bug on that page. I'll get that fixed...)

Oh, but if you use cygwin perl, fork and exec work fine and do create new processes.

Replies are listed 'Best First'.
Re^2: How to portably stop processes?
by haj (Vicar) on Mar 31, 2023 at 18:54 UTC
    Actually fork and exec don't "work fine" on Windows :-(

    Fair enough: I should have been more specific. They were good enough for my particular problem ... until I wanted to have "infinite" processes.

    And indeed, Proc::Background is pretty much exactly what I was hoping for. Thanks a lot!

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2023-12-04 12:31 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (25 votes). Check out past polls.