in reply to latest on ithreads vs forks?

You have to remember that Liz's "forks.pm" module, while very cool, is just one possible implementation of sharing data across forked processes. Depending on what you are doing, it may be possible to do something much more efficient. The forks.pm module is constrained by the fact that it is trying to match the threads API and to be portable across many OSes. Those are not important considerations for most in-house apps.

Replies are listed 'Best First'.
Re: Re: latest on ithreads vs forks?
by Anonymous Monk on May 26, 2004 at 22:12 UTC
    True, but even if I fire off threads/processes that just print a message and do no sharing, ithreads were faster. That suggests to me that the overhead of forks is greater than that of threads.
      Are you on Windows? Forking is mostly faked on Windows. Are you loading any modules before using threads? Threads cause all loaded code to be copied into each spawned interpreter. Did you try a simple $pid = fork() approach? There may be overhead in forks.pm due to the emulation of the threads API.
        The latest versions of forks do not install on Win32 at all anymore. It just doesn't make sense. It also didn't work. And I couldn't be bothered to find out why, as it doesn't make any sense to use forks.pm on Win32 systems (with fork() being emulated in threads).

        Liz