in reply to Re: 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 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' }

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