in reply to Re: latest on ithreads vs forks?
in thread latest on ithreads vs forks?

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.

Replies are listed 'Best First'.
Re: Re: Re: latest on ithreads vs forks?
by perrin (Chancellor) on May 26, 2004 at 22:53 UTC
    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