in reply to Re: Writing threadsafe perl extensions
in thread Writing threadsafe perl extensions
if Math::GMP were threadsafe, would you expect that the following also outputs the same:#!perl -slw use Math::GMP; my $ret = Math::GMP->new('123' x 11); print Math::GMP::get_str_gmp($ret, 10); __END__ C:\_32\pscrpt\threads>perl gmp2.pl 123123123123123123123123123123123
(It doesn't - it just segfaults.) Does that therefore prove that Math::GMP is not threadsafe ? - or is there yet a possible rendition that may prove fruitful ?#!perl -slw use threads; use Math::GMP; sub t1 { my $mbi = Math::GMP->new($_[0]); return $mbi; } my $th1 = threads->new(\&t1, '123' x 11); my $ret1 = $th1->join; print Math::GMP::get_str_gmp($ret1, 10);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Writing threadsafe perl extensions
by BrowserUk (Patriarch) on Oct 21, 2007 at 15:15 UTC | |
by syphilis (Archbishop) on Oct 21, 2007 at 23:48 UTC | |
by BrowserUk (Patriarch) on Oct 22, 2007 at 00:01 UTC | |
by syphilis (Archbishop) on Oct 22, 2007 at 01:41 UTC | |
by BrowserUk (Patriarch) on Oct 22, 2007 at 02:19 UTC | |
|