Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Window + fork + Crypt::Random = pain

by ikegami (Patriarch)
on Mar 07, 2007 at 01:45 UTC ( #603546=note: print w/replies, xml ) Need Help??


in reply to Window + fork + Math::Pari = pain

fork doesn't really have anything to do with it. It's about threading. Keep in mind that fork creates a new *thread* in Windows, not a new *process*. The problem can be triggered more directly using:

perl -MMath::Pari -Mthreads -e "threads->create(sub{})->join();"

It appears that Math::Pari is not thread-safe.

Replies are listed 'Best First'.
Re^2: Window + fork + Crypt::Random = pain
by bsb (Priest) on Mar 07, 2007 at 02:49 UTC
    I'm using the Math::Pari ppm but it's build process seems to only use the unix source PariBuild.pm
    sub download_pari { my ($srcfile, $force) = (shift, shift); my $host = 'megrez.math.u-bordeaux.fr'; my $dir = '/pub/pari/unix/'; my($ftp, $ua, $base_url); ...
    There is a windows build at ftp://megrez.math.u-bordeaux.fr/pub/pari/windows/ which may avoid the problem although I haven't yet tried to use it.

    Thanks for your reply

      If the module isn't thread safe, a special windows build wouldn't avoid the problem.
        Some C libraries can be compiled to be threadsafe but are not by default, eg. SQLite. (I admit that's probably not the case here)
Re^2: Window + fork + Crypt::Random = pain
by bsb (Priest) on Mar 07, 2007 at 03:52 UTC
    That also segfaults in linux.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2022-05-28 17:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (99 votes). Check out past polls.

    Notices?