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

Hi. I just made multithreaded script in Perl for Windows. Here is the script:

use Thread;

my $t1 = new Thread \&start_sub;
my $t2 = new Thread \&start_sub2;

$t1->join;
$t2->join;

start_sub
{
system("c:\\valeriy\\program2\\pr1.pl");
}

start_sub2
{
system("c:\\valeriy\\program2\\pr2.pl");
}


After executing I get:

>C:\Valeriy\Program2>mainpr.pl
No threads in this perl at C:\Valeriy\Program2\MainPr.pl line 3.

--------------
What does it mean? I use Perl v5.6.0 from ActiveState. Thanks.

Replies are listed 'Best First'.
(Ovid) Re: No threads in this Perl???
by Ovid (Cardinal) on Sep 23, 2000 at 01:59 UTC
    Here's what the ActiveState documentation says about use Thread:
    The Thread extension requires Perl to be built in a particular way to enable the older 5.005 threading model. ActivePerl is not built this way, which means this extension will not work under ActivePerl. If you wish to use the 5.005 threading model, you will need to compile Perl from the sources to enable this feature.
    Sorry for the bad news!

    Cheers,
    Ovid

    Join the Perlmonks Setiathome Group or just go the the link and check out our stats.

      To add a slight bit to this: ActivePerl 5.6.0 has thread support in the form of a fork which actually creates threads. This is new code and still pretty buggy. If you compile your own copy of Perl to use another threading model then you won't be able to use fork() with that version of Perl (for Win32).

      The demand for a pseudo-fork() was part of the reason ActiveState decided to not support 5.005-style threads in 5.6.0. Another part of the reason is probably that the future of threads in Perl5 (if there is any at all now that Perl6 is in the works) could go several directions and there didn't seem to be a strong consensus on which way to choose so 5.005-style threads might not see much more development.

      Although the 5.005-style threading support was still buggy, you might have better luck with it than with the current pseudo-fork().

              - tye (but my friends call me "Tye")