[Melbourne-pm] fork()ing Windows

Leigh Sharpe lsharpe at pacificwireless.com.au
Sun Jul 24 17:30:25 PDT 2005


Hi All,
 Can anybody tell me what the status of fork() is on windows?
I have a program I am trying to port from Linux to Windows. The program uses quite a few fork()s. The basic structure is something like this:

for (;;)
{
    my $pid=fork;
    unless ($pid)
    {
        #Do something here.
        exit;
    }
    my $pid2=fork;
    unless ($pid2)
    {
        #do something else here
        exit;
    }
    my $pid3=fork;
    unless ($pid3)
    {
        #And do something different again here..
        exit;
    }
    sleep($an_arbitrary_amount);
    kill ('USR1',$pid2);
}

Under Perl V5.6.1, is the fork function able to handle this, or do I need to use Win32::Process to create distinct processes for each child? I have heard that windows doesn't fork very well.
And what about the kill(USR1)?  


Regards,
             Leigh
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/melbourne-pm/attachments/20050725/30063c37/attachment.html


More information about the Melbourne-pm mailing list