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

Re^11: PDL and srand puzzle - PDL::srand/srandom not working

by marioroy (Prior)
on Jun 08, 2024 at 06:40 UTC ( [id://11159831]=note: print w/replies, xml ) Need Help??


in reply to Re^10: PDL and srand puzzle
in thread PDL and srand puzzle

See my reply to Rob. In short, calling PDL::srandom before spawning workers has no effect. The workaround is to call CORE::srand instead.

See also, non-thread testing.

Edit: MCE checks for PDL::Primitive->can('srand'), but missed checking PDL::Primitive->can('srandom'). Resolved in MCE v1.894 and MCE::Shared v1.889.

Replies are listed 'Best First'.
Re^12: PDL and srand puzzle - PDL::srand/srandom not working
by etj (Priest) on Jun 09, 2024 at 13:08 UTC
    Calling srand cannot be a workaround for this, because there is no interaction between Perl's RNG and PDL's. They are separate systems.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2025-02-09 15:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (96 votes). Check out past polls.