Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I have Perl 5.005_03 or 5.6.0 on my Linux servers - always the default install from the distribution. I understand that after 5.005 Perl has thread support.

When I try use Thread; I always get a missing module error. When I try install Thread under perl -MCPAN -e shell it always tries to install Perl 5.6.1. I cannot find the basic Thread package on cpan.org.

How do I get thread support?

Thanks,
Tim E.

Replies are listed 'Best First'.
(tye)Re: How do I get thread support?
by tye (Sage) on Jul 21, 2001 at 02:34 UTC

    The threading model was different in 5.005 vs. 5.6 and which threading model (if any) that Perl supports is determined when Perl is compiled (and Perl doesn't support more than one threading model at a time).

    To see which version of threading (if any) you have supported in your copy of Perl, you can search for "thread" in your Config.pm file until you find an entry that is set equal to 'define'. Each threading model requires a different threading module. You might need to use "ithread" (don't know the letter case of that) instead of Thread, for example.

            - tye (but my friends call me "Tye")
Re: How do I get thread support?
by Graham (Deacon) on Jul 21, 2001 at 02:42 UTC
    I have found thst the included distros tend to be non-threaded
    You will probably have to build it yourself from source and specify a threaded perl when asked.

    Or you could remove your distro's perl and replace it with a threaded one.
    SiePerl 5.6.1 has thread support. Not sure about the ActiveState one though.