> Hi,
>
> I tested with a while loop. They do change after
> a while. This probably has to do with how the
> output is done on the same terminal in windows
> and how it handle timesharing.
>
> Fork does work correctly with my version
> of ActivePerl on Win32...
>
> -Robin
>
> -----Original Message-----
> From: Paul Murphy [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, June 29, 2001 11:22 AM
> To: [EMAIL PROTECTED]
> Subject: Win32 fork(), parent then child
>
>
> Hey everyone:
>
> Anyone using fork() in Win32 ActivePerl?
>
> Consider the following code:
>
> <code>
>
> use FileHandle;
>
> STDOUT->autoflush(1);
>
> $kidpid = fork();
> print "pid = $$ kidpid = $kidpid\n";
> print "pid = $$ kidpid = $kidpid\n";
> print "pid = $$ kidpid = $kidpid\n";
> print "pid = $$ kidpid = $kidpid\n";
> print "pid = $$ kidpid = $kidpid\n";
> print "pid = $$ kidpid = $kidpid\n";
> print "pid = $$ kidpid = $kidpid\n";
> print "pid = $$ kidpid = $kidpid\n";
> print "pid = $$ kidpid = $kidpid\n";
>
> </code>
>
> I would have thought that the child and parent output would be
> intermingled.
>
> But they don't, the child code gets executed after the parent code is
> complete. Which kinda defeats the purpose.
>
> I have even put in a while() after this that bails when I tell it. The
> child code gets executed once I let the parent process terminate, or at
> least the output arrives after the output of the first is complete. But I
> have stdout autoflushed.
>
> Am I missing something here?
>
> Paul.
>
>
>
>
>
> --------------------------------------------------------------------------
> -------------------------------------------------
> CRESTCo Ltd. The views expressed above are not necessarily
> those
> 33 Cannon Street. held by CRESTCo Limited.
> London EC4M 5SB (UK)
> +44 (020) 7849 0000 http://www.crestco.co.uk
> --------------------------------------------------------------------------
> -------------------------------------------------