in reply to Why use threads over processes, or why use processes over threads?

The performance difference is also a winning point for thread over processes.

Excuse me? Perhaps you missed this post by liz discussing Perl's ithreads. Sure, in theory threading might be better than forking, but in practice (in Perl) it is anything but "lightweight" or "fast". And that's not even considering leaks or bugs, that's just considering the current design. I'll stick with fork for concurrent programming on *nix, and one of these days I'll get around to trying out liz's drop-in forks replacement for threads.

  • Comment on Re: Why use threads over processes, or why use processes over threads?

Replies are listed 'Best First'.
Re: Re: Why use threads over processes, or why use processes over threads?
by pg (Canon) on Nov 11, 2003 at 07:44 UTC
    And that's not even considering leaks or bugs, that's just considering the current design.

    To be fair, I believe that they didn't mean to say memory leak is feature. We all know that, to use big amount of memory is different from momery leak.

    I guess what they meant was that the current thread design and implementation in Perl took lots of memory.

    I think what they tried to do is to make it work first, in a easier way, and try to cut down memory usage at a later point. I agree it is not ideal, and not a good design, but I believe that all of us, at some point, have experienced the situation where you have to deliver your project phase by phase.

    Really, take a look at 5.10 doc on thread, they are fixing the memory leaks, and they also did something to cut down the meory usage for thread.