Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Trying to Understand the Discouragement of Threads

by benwills (Sexton)
on Nov 18, 2014 at 07:08 UTC ( [id://1107541]=note: print w/replies, xml ) Need Help??


in reply to Re: Trying to Understand the Discouragement of Threads
in thread Trying to Understand the Discouragement of Threads

Sure. The perl documentation, for example: http://perldoc.perl.org/threads.html

The "interpreter-based threads" provided by Perl are not the fast, lightweight system for multitasking that one might expect or hope for. Threads are implemented in a way that make them easy to misuse. Few people know how to use them correctly or will be able to provide help. The use of interpreter-based threads in perl is officially discouraged.

And it seems like most of the posts or suggestions to use threads (that I've come across) are often countered saying that threads shouldn't be used, are heavier, more confusing, etc. If you'd like references, I can go pull some up from links I've saved.

  • Comment on Re^2: Trying to Understand the Discouragement of Threads

Replies are listed 'Best First'.
Re^3: Trying to Understand the Discouragement of Threads
by syphilis (Archbishop) on Nov 18, 2014 at 09:54 UTC
    The use of interpreter-based threads in perl is officially discouraged

    I seem to recall that I've seen others making reference to that statement, too.
    I think that you (or at least someone who cares about threads) should challenge that remark with p5p by filing a perlbug report that requests a "please explain the reason that remark is there".
    You should point out that, IYO, threads is a useful and important part of perl and that discouraging people from using it is stupid, counter-productive and plain wrong ... or whatever words you choose to make your point :-)

    At worst they can only decide to reject your bug report and close it without taking any action.

    Cheers,
    Rob
Re^3: Trying to Understand the Discouragement of Threads
by Anonymous Monk on Nov 18, 2014 at 07:13 UTC

    And it seems like most of the posts or suggestions to use threads (that I've come across) are often countered saying that threads shouldn't be used, are heavier, more confusing, etc.,

    Well not on perlmonks ;) I've only seen it twice, and its just someone quoting form the BS discouragement docs without any understanding ... fork doesn't work on windows, threads work

      Well, to be honest, perlmonks was consistently the highest-quality source for me in getting this thing made. But it sounds like you might have expected that. ;)

      I think my question/curiosity might be coming from not understanding who to listen to...and I would see posts with clear thread solutions, where someone would often chime in suggesting using another package. Then I'd run of to test that and, every time, would be disappointed by the performance of the non-thread suggestion. Combined with the "official" discouragement, it makes me wonder if there's a shorter shelf life for my code and if maybe I'm was just missing something.

        "Combined with the "official" discouragement, it makes me wonder if there's a shorter shelf life for my code and if maybe I'm was just missing something."

        Although the Perl documentation now discourages using threads for a variety of vague reasons, do note that the word discouraged was carefully chosen. In particular, the word deprecated was explicitly not used.

        There are no plans to remove thread support from Perl in the foreseeable future.

        Before continue be sure to read The problem with "The Problem with Threads" then because we have good thread safe monks here around search for them.

        HtH
        L*
        There are no rules, there are no thumbs..
        Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1107541]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-19 20:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found