Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Perl threading problem?

by hdb (Monsignor)
on Jan 17, 2014 at 14:08 UTC ( [id://1070964]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2024-04-24 17:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found