in reply to DBI and fork() on Win32

Is there really a difference between fork() and system() on Windows? System is implemented in most places as a fork, then as exec, with the parent simply waiting for the child to exit. There should be no difference. One thing the DBI page suggests:
$rc = $dbh->disconnect or warn $dbh->errstr;
which might shed some light. Also, unless your code is incomplete, I don't see 'use strict' or 'use warnings'. It also might be helpful to identify the database you are using.

Replies are listed 'Best First'.
Re^2: DBI and fork() on Win32
by BrowserUk (Patriarch) on Feb 10, 2009 at 15:02 UTC
    Is there really a difference between fork() and system() on Windows? System is implemented in most places as a fork, then as exec, with the parent simply waiting for the child to exit. There should be no difference.

    Yes. They are completely different on Win32. There is no OS provided fork on win32, so system cannot be implemented using "fork & exec".


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re^2: DBI and fork() on Win32
by ikegami (Patriarch) on Feb 10, 2009 at 15:48 UTC

    Is there really a difference between fork() and system() on Windows?

    Windows has neither a fork system call nor an exec system call. Necessarily, yes, they are different.

    Perl emulates fork using threads, whereas system results in a call to CreateProcess.

    [ Oops, I opened the parent a while before I replied and forgot to check if it was already answered. ]