develooper Front page | perl.perl5.porters | Postings from May 2015

Re: [perl #125106] Why are threads discouraged?

Thread Previous | Thread Next
From:
Rocco Caputo
Date:
May 5, 2015 17:50
Subject:
Re: [perl #125106] Why are threads discouraged?
Message ID:
31219149-7428-43FB-A741-39ED2D742B70@pobox.com
> On May 5, 2015, at 11:23, Eric Brine <perlbug-followup@perl.org> wrote:
> 
> # New Ticket Created by  "Eric Brine" 
> # Please include the string:  [perl #125106]
> # in the subject line of all future correspondence about this issue. 
> # <URL: https://rt.perl.org/Ticket/Display.html?id=125106 >
> 
> 
> threads.pm says:
> 
> The use of interpreter-based threads in perl is officially discouraged.
> 
> 
> Why is that? Is it just because they're rather heavy? If so, why not just
> say so and let the user decide whether he wants to use them or not? After
> all, heavy threads aren't a problem if you reuse them (as in a worker
> model).

If your documentation is anything like mine, the paragraph before that statement tries to explain why.  Perhaps the discouragement should begin with "Because of this, the use of...." to hint that the reader may have skipped something important and to discourage people from taking a provocative statement out of context.

The discouragement was added on Mar 2, 2014 after an intense deliberation on perl5-porters:

"RFC: add discouragement warning to perl threads documentation"
http://www.gossamer-threads.com/lists/perl/porters/305035

The RFC was a product of an observation in irc.perl.org #p5p that most people in the Perl community, when asked for help with threads in Perl, will harshly denounce their viability and recommend that the problematic program be gutted and rewritten with almost anything but.

The #p5p IRC discussion began on Feb 19, 2014, with "Perl's threads are socially weird.  They exist and are supported, but they (and their users) are heavily deprecated in the community."

Or it began with an observation about 90 minutes earlier in a #p5p discussion with/about a Perl novice:

right, because most channels don't answers threads questions
because most channels are full of people who don't use threads.pm
because 'use threads;' almost always indicates brain damage

-- 
Rocco Caputo <rcaputo@pobox.com>
Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About