You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fork(2) emulation in windows has various limitation and would introduce some "mysterious" issues.
So I will not use fork(2) in windows.
I was thinking something like:
#!/usr/bin/env perluse strict;
use warnings;
if ($ENV{WORKER_PROCESS}) {
# This is worker process# connect the main process by IO::Socket::INET....
...;
exit;
}
# This is main processmy%pid;
formy$i (1..5) {
local$ENV{WORKER_PROCESS} = 1;
my$pid = system {$^X} 1, $^X, $0;
$pid{$pid}++;
}
# connect worker processes by IO::Socket::INET...
...;
while (%pid) {
my$pid = wait;
if (delete$pid{$pid}) {
# OK
} else {
warn"unexpected";
}
}
It may be possible to support windows if we use IO::Socket::INET + system 1, cmds.
The text was updated successfully, but these errors were encountered: