Perl threads and libwww wierdness
liz at dijkmat.nl
Sun Dec 25 10:32:41 GMT 2011
On Dec 19, 2011, at 9:50 AM, Yitzchak Scott-Thoennes wrote:
> On Sun, Dec 18, 2011 at 11:31 PM, Toby Wintermute <tjc at wintrmute.net> wrote:
>> 2011/12/16 Peter Vereshagin <peter at vereshagin.org>:
>>> 2011/12/16 12:38:16 +1100 Toby Wintermute <tjc at wintrmute.net> => To London.pm Perl M[ou]ngers :
>>> TW> > (i)Threaded perl5 ( 'use threads' ) doesn't seem to be recommended for
>>> TW> > production environments.
>>> TW> I know it certainly wasn't recommended back in the days of 5.6 or 5.8,
>>> TW> but I thought things had improved since then..
>>> They did. Perl6 was released and it seems to have threads those can be recommended.
>>> Perl5 have fork() that 'just works' and seems to be enough.
>> So, you're saying that threads under perl5 is forever going to be
>> considered broken and not worth touching then? :(
>> Why do all the main distros ship a threading-enabled Perl? I note that
>> Padre won't build without threads enabled either.
> Because threads are cool and all the cool languages have them?
> My take is that because perl's ithreads are so expensive (in time
> and memory both to start them up and to share data), you are almost
> always better off designing your code to work with forks instead.
> I just don't see the compelling use case for threads, unless you are
> stuck in the threading mindset.
And if you are, you might want to look at the forks.pm module. It provides the threads.pm API using fork().
More information about the london.pm