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

I did notice that, many people (not all) from a unix/c background, tend to use threads over processes. I believe this is largely because unix/c thread has been very mature for quite a long time already, and on the same page, fork has been obsoleted in lots of those people's mind for quite a long time.

I acknowledge that Perl has its unique situation, however as Perl is largely based on c, I don't see a reason why Perl will not follow the same path, although the trend is just started.

If I didn't observe it wrong, Perl creators are pushing the use of Perl thread, and the more mature perl thread is, the more of this kind of push will come from them.

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

Replies are listed 'Best First'.
Re: Re: Re: Why use threads over processes, or why use processes over threads?
by Juerd (Abbot) on Nov 11, 2003 at 09:12 UTC

    I did notice that, many people (not all) from a unix/c background, tend to use threads over processes.

    I noticed the exact opposite.

    I acknowledge that Perl has its unique situation, however as Perl is largely based on c, I don't see a reason why Perl will not follow the same path, although the trend is just started.

    Perl copies the entire interpreter when a thread is created. This is slow, inefficient and memory consuming. With forking on the other hand, all the modern platforms use Copy-on-Write, meaning that most of the interpreter is never copied, but stays shared all the time. A fork is fast, efficient and by itself doesn't use a lot of memory.

    Perl's C roots have almost nothing to do with this all. Perl is VERY different from C. It just happens to have a few similar functions, and a syntax that to some looks much alike.

    Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

Re: Re: Re: Why use threads over processes, or why use processes over threads?
by castaway (Parson) on Nov 11, 2003 at 12:18 UTC
    I was actually observing (in myself and others), the exact opposite, unix/c people tend to prefer forks over threads. (I don't belong to that group..)

    C.