Re: Threaded Gtk2->main causing seg fault



Ross McFarland writes:
perl threads have lots of issues which is why many distros don't consider them
stable enough to put in their perl builds.

And I'll pipe in with my usual tired refrain: As someone who's done a
*lot* of threading and learned the hard way, the only reason to use
threads is that you're working on an OS that doesn't deal with
processes well. Modern Un*ces do processes very well, interprocess
pipes are roughly the speed of memcpy()s if done correctly, shared
memory works, you get better memory protection, and you get real
address space.

If you're working on Windows then yes, sometimes you need to use
threads because of limitations in the API, and because processes are
so heavyweight. If you're working on a Un*x with copy-on-write (ie:
anything modern on a desktop processor or embedded processor with MMU)
then any slight speed gain and short-term architecture cleanliness
from using threads is monstrously offset by the long-term maintenance
and resource allocation downsides.

You want fork(), not pthread_create() (or whatever the Perl equivalent
is).

Dan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]