Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re^3: Trying to Understand the Discouragement of Threads

by Anonymous Monk
on Nov 18, 2014 at 07:13 UTC ( #1107542=note: print w/replies, xml ) Need Help??

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

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

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

Replies are listed 'Best First'.
Re^4: Trying to Understand the Discouragement of Threads
by benwills (Sexton) on Nov 18, 2014 at 07:24 UTC

    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.

        I've run into exactly that issue and asked in the Chatterbox where I was given a short explanation and a pointer to this discussion.

        I object about "discouraged" being a wise choice. IMO this discourages the not-so-newbies who know about perlpolicy and how to interpret it. If anything, newbies probably give less weight to it (out of sheer ignorance) or (willingly) do not care about potential long-term consequences.

        Having been burnt by the given-when deprecation fiasco, I was quite repelled by the mention of "officially discouraged" in threads and now I come to know that this particular formulation is just smoke and mirrors to repel "annoying newbies".

        Not good.

            All Perl:   MT, NLP, NLU

      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.

      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.

        Interesting. If it's because they're harder and more confusing than other solutions, that's unfortunate they would respond they way they did. Especially because, if you follow the link to what "discouraged" means, it says:

        "From time to time, we may mark language constructs and features which we consider to have been mistakes as discouraged. Discouraged features aren't currently candidates for removal, but we may later deprecate them if they're found to stand in the way of a significant improvement to the Perl core.

        When I read that, it sounded to me like threads were possibly going to be making an exit from perl. If they had said "look...these are hard to do well," it could have saved me a lot of confusion and running around. I think I also don't understand why the time and energy that goes into that whole process of getting that into the documentation doesn't go to better informing and teaching others the best/right way to use them if they are, in fact, often the better solution. But I guess that's a philosophical difference.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2022-08-12 06:40 GMT
Find Nodes?
    Voting Booth?

    No recent polls found