Merrill Cornish [mailto:[EMAIL PROTECTED]] wrote:

> However, Unix has a real fork().  So how does forking a 
> process compare in 
> start-up time and memory requirements as compared to creating 
> a new thread?

Check the c.l.p.m newsgroup for many discussions on threads vs. forks. I'll
pull a short answer from one of the discussions:

<quote author="Dan Sugalski">

Using fork saves you from programming errors that would nuke your process
when running threaded. This is generally a good thing. On the other hand,
sharing data between forked processes is significantly more expensive than
sharing it between threads, and there are things (such as database
connections) that you can't always share between processes.

Thread switches are also cheaper than process switches, though that's not
a big deal with perl since other factors swamp the (relatively small) task
switch penalty.

</quote>

-- 
Mark Thomas                    [EMAIL PROTECTED]
Internet Systems Architect     User Technology Associates, Inc.

$_=q;KvtuyboopuifeyQQfeemyibdlfee;; y.e.s. ;y+B-x+A-w+s; ;y;y; ;;print;;
 

_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to