Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: How to portably stop processes?

by LanX (Sage)
on Apr 01, 2023 at 01:23 UTC ( #11151404=note: print w/replies, xml ) Need Help??


in reply to Re^2: How to portably stop processes?
in thread How to portably stop processes?

> My program spawns several processes

Correction: it spawns several pseudo-processes on windows which are all emulated inside the main process.

That's also why taskkill can't work, the $child_id you get from fork is meaningless for the OS.

https://perldoc.perl.org/perlfork#SYNOPSIS

On some platforms such as Windows where the fork() system call is not available, Perl can be built to emulate fork() at the interpreter level. While the emulation is designed to be as compatible as possible with the real fork() at the level of the Perl program, there are certain important differences that stem from the fact that all the pseudo child "processes" created this way live in the same real process as far as the operating system is concerned.

Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2023-06-04 10:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (20 votes). Check out past polls.

    Notices?