in reply to Re: Perl threading problem?
in thread Perl threading problem?

Your comment might be correct, but it could also be interpreted in the sense of the OP in that changing the subroutine changes the number of threads being used.

From my experiments I do follow Athanasius' explanation.

Replies are listed 'Best First'.
Re^3: Perl threading problem? (But even so... :)
by BrowserUk (Patriarch) on Jan 17, 2014 at 14:55 UTC

    But even so, both threads do run eventually, it just takes a while before they get spawned:

    C:\test>perl -Mthreads -Mbignum -wE"$_->join foreach map async { say t +hreads->tid; 2**8-1 } , 1..2" 1 2 C:\test>perl -Mthreads -Mbignum -wE"$_->join foreach map async { say t +hreads->tid; 2**85-1 } , 1..2" 1 2 C:\test>perl -Mthreads -Mbignum -wE"$_->join foreach map async { say t +hreads->tid; 2**859-1 } , 1..2" 1 2 C:\test>perl -Mthreads -Mbignum -wE"$_->join foreach map async { say t +hreads->tid; 2**8594-1 } , 1..2" 1 2 C:\test>perl -Mthreads -Mbignum -wE"$_->join foreach map async { say t +hreads->tid; 2**85943-1 } , 1..2" 1 2 C:\test>perl -Mthreads -Mbignum -wE"$_->join foreach map async { say t +hreads->tid; 2**859433-1 } , 1..2" 1 2

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re^3: Perl threading problem? (Corrected!)
by BrowserUk (Patriarch) on Jan 17, 2014 at 14:29 UTC

    Oh. I see. It is the use bignum that prevents it from reaching the point where the threads spawn.

    How very strange ... though it's not the first time I've seen problems caused by these overload everything in sight modules.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.