Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Threading - Best Practices

by P0w3rK!d (Pilgrim)
on May 15, 2003 at 15:49 UTC ( #258412=perlquestion: print w/replies, xml ) Need Help??

P0w3rK!d has asked for the wisdom of the Perl Monks concerning the following question:


I was unable to find a tutorial on threading with Perl in the Tutorials section. Also, there appears to be nothing written but a table of contents here:



..and yes..they are the same appears that neither of them have been written yet. :(

Does any one out there have any links they can share with the monestary on best practices for threading with Perl?

Thanks :)


Replies are listed 'Best First'.
Re: Threading - Best Practices
by hardburn (Abbot) on May 15, 2003 at 15:51 UTC

    There is this article on the new perl 5.8.0 threading system.

    I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
    -- Schemer

    Note: All code is untested, unless otherwise stated

Re: Threading - Best Practices
by jsprat (Curate) on May 15, 2003 at 16:13 UTC
    The tutorial has been written - try this link perlthrtut and hit the first link. Or just type perldoc perlthrtut at a command prompt or shell. Or, if you have ActiveState Perl, all the documentation (including the threading tutorial) is available locally in html format as well as the pod.

    You may want to look at How to RTFM, lots of good advice. Good luck

      Thank you :)

      BTW-I did RTFM. I checked the website and other sources. I also thought it would be a good topic to bring up. Wait before you pull the RTFM trigger next time ;)</>

Re: Threading - Best Practices
by hossman (Prior) on May 15, 2003 at 17:44 UTC

    The problme you are having is because of a missunderstnading of how converts/structures it's docs.

    What you are looking at is the "perltoc" man page, which just lists the table of contents of all the manpages ... those links are the same because they are just designed to link back to the top of the main TOC.

    The Doc you probably want to start from is the "perl" man page, which links to the "perlthrtut man page.

Re: Threading - Best Practices
by tilly (Archbishop) on May 17, 2003 at 20:42 UTC

    Seriously, before you try it, carefully think through why you want threading. Odds are that you don't, really. And there are a lot of potential things that can go wrong which are really hard to debug (specifically race conditions). Unless you have a good reason to open that can of worms, I wouldn't.

      /msg p5p cease development on threads, nobody is going to use them. They are too hard.


        The truth is that people will use threads. Why? First of all they are the best solution to certain classes of user interaction problems. Also a lot of people think that they are cool. And programmers who are used to languages or environments where you thread everywhere just find them familiar. Therefore it makes sense for p5p to try to support them.

        What I would like is for people to not get burned by using threads where it doesn't make sense to.

        For one description of why it sometimes doesn't make sense to use them, see Threads vs Forking (Java vs Perl).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://258412]
Approved by valdez
Front-paged by broquaint
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2020-09-23 08:47 GMT
Find Nodes?
    Voting Booth?
    If at first I donít succeed, I Ö

    Results (130 votes). Check out past polls.