in reply to xs outputs faster than perl can keep up
As diotalevi said, I suspect this is another variant of "suffering from buffering", i.e. the XS code is using a different output buffer than the Perl code.
I think some change will have to be made to the XS code: for example, (a) make it output the newlines itself (directly where it outputs the numbers), (b) make it use the same buffer that Perl's print or syswrite is using, (c) make sure the ouput from within XS is flushed every time after writing a number (this might still be tricky, though), or (d) change the API of Rmpfr_out_str() to return the number, so you can ouput everything synchronously from the Perl side... (I haven't looked at Math::MPFR - maybe there already is such a function...).
(a) or (d) is probably easiest, with (a) being fastest...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: xs outputs faster than perl can keep up
by syphilis (Archbishop) on Feb 07, 2007 at 05:44 UTC |