in reply to Sockets: TMTOWTDI (BWWIB)?

I would choose threads over process, unless threads is not available, which is not (no longer) the case in Perl. When both threads and process can provide concurrent programming, why threads over process? my two-penny answer:

Replies are listed 'Best First'.
Re: Re: Sockets: TMTOWTDI (BWWIB)?
by IlyaM (Parson) on Dec 16, 2002 at 09:33 UTC
    It is very OS dependant. For example on Linux creating a new process is not more expensive that creating threads (after all internally creating process and thread is almost same thing for Linux). Nor it takes more memory because of copy on write. Perfomance is not necessary better with threads because they have overhead or synchronization and locking which separate processes do not have.

    Add to this that some OS don't have good threads implementation yet (STABLE branch of FreeBSD comes to my mind) and Perl's support for them is still very experimental (even in 5.8.0).

    --
    Ilya Martynov, ilya@iponweb.net
    CTO IPonWEB (UK) Ltd
    Quality Perl Programming and Unix Support UK managed @ offshore prices - http://www.iponweb.net
    Personal website - http://martynov.org