ints in parallel code
Johannes Singler
singler@kit.edu
Fri Nov 6 11:22:00 GMT 2009
Paolo Carlini wrote:
> Paolo Carlini wrote:
>> today was going through the parallel code to do some more or less
>> formatting and uglifications fixes, when I noticed something potentially
>> much more serious: I'm seeing many plain ints around, also for things
>> which look like indexes in data, differences of iterators, things like
>> that.
> In particular, I wish you could double check the various ints used in
> the *multiway* functions, which seem all suspect to me.
All the ints in multiway*.h address sequences, i. e. the functions are
limited to about 2^31 sequences. The number of elements in these
sequences can be much higher.
In principle, you are right, the sequences are passed using iterators,
and their difference could be 64 bits. In practice, we are much further
away from having more than 2^31 sequences, than having more than 2^31
elements e. g. for sorting.
Anyway, do you want me to replace it with the appropriate
difference_type? It might have performance implications, though.
Johannes
More information about the Libstdc++
mailing list