[Shootout-list] Re: Integer overflow
Brent Fulgham
bfulg@pacbell.net
Sat, 25 Sep 2004 23:12:32 -0700
On 2004-09-25 20:43:55 -0700 Isaac Gouy <igouy2@yahoo.com> wrote:
> -snip-
>> the producer/consumer threads test ...
>> it was originally designed to show the cost of forking new processes.
>
> typo? It only forks 2 threads. It switches thread context many times.
Ahh -- yes, you are right. So this would be our concurrency test.
Perhaps it
is not complicated enough?
> -snip-
>> Whether overflow moves from "bug" to "safety issue" depends on what
>> is done with the output.
>
> Perhaps we have to bite-the-bullet and change existing code, so that
> we
> can keep the fastest run-time up-around 0.5s and keep the largest ints
> within range. Oh for a slower machine ;-)
Why don't we modify the input file so that it includes sufficient
distribution of
positive and negative numbers that any combination of copies of the
file
is always clamped below 2^30? This should address Brandon and Brian's
concerns, while giving me a philosophical way out of the argument :-)
-Brent