Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Trying to Understand the Discouragement of Threads

by FloydATC (Deacon)
on Nov 18, 2014 at 20:46 UTC ( #1107643=note: print w/replies, xml ) Need Help??

in reply to Trying to Understand the Discouragement of Threads

I can only speak for myself but I really dislike Perl threads for two reasons:

  1. Data is NOT shared between threads unless you go to extreme lengths to share them. For large complex data structures you'll save yourself a lot of time if you just go with fork() and some sort of inter-process communication instead because it'll be far easier to debug. For me, this goes against the whole point of threads. Compare and contrast with Java threads, about the only thing in Java that actually works exactly as you would expect. You even get a hash class that automagically takes care of locking issues for you, how neat is that?
  2. Too many of the really useful modules on CPAN will just blow up in your face if you try to use them with threads. To work around those issues, threaded scripts have to jump so many hoops you end up losing sight of whatever advantage threads were supposed to give you in the first place.
Talking about threads in Perl makes me sad because it's the one thing I really don't like about my favorite language.

-- FloydATC

Time flies when you don't know what you're doing

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

Log In?

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

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

    No recent polls found