in reply to Why use threads over processes, or why use processes over threads?
I learned perl using the Camel, starting at the beginning.. Threads have more coverage there than forking, in fact, forking is mentioned only as a way of doing interprocess communication. Which would make sense to me, were I aiming to create separate processes, which I havent wanted to do, yet.. (Actually I did once, but then I just split my program into two, and communicated using sockets, which was easier in the end..)
I don't come from a unix/C background, so I've no history of forks, the why and how of them, and since threading works fine for me, I'll continue to use it (both 5005 and ithreads)
None of this says if threads are better than forks, or vice versa, the only thing I know about forks is that it seems to be more difficult to communicate between forked processes (using Thread::Queue or shared vars in threads is easy..) So, no clue there.
I'd say, threads for self-contained programs in which the threaded bits need to communicate, and forks for extra processes which do something entirely separate.. I'd assume that people use forks for things I'd use threads for just because perl threads weren't seen as any good for a long time, but that's probably just my opinion :)
C.
(Nodes are threaded, not forked, here, makes perfect sense to me :)
|
---|
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 08:35 UTC | |
by Juerd (Abbot) on Nov 11, 2003 at 09:12 UTC | |
by castaway (Parson) on Nov 11, 2003 at 12:18 UTC |