Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

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

by ikegami (Patriarch)
on Mar 07, 2007 at 01:45 UTC ( [id://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
    sub download_pari { my ($srcfile, $force) = (shift, shift); my $host = ''; my $dir = '/pub/pari/unix/'; my($ftp, $ua, $base_url); ...
    There is a windows build at 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?

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-22 23:19 GMT
Find Nodes?
    Voting Booth?

    No recent polls found