Print

Print


  Hi Andy,

On Tue, Sep 14, 2004 at 10:29:31PM -0700, Andrew Hanushevsky wrote:
> Yes, you can suffix "ll" to the constant. I'm not sure if that's portable,
> necessarily. Even if it were, that would force you to know what the type
> of the server mask was. All the code in the olbd hides the type so that if
> it ever were necessary to make it bigger than 64 bits, you can easily do
> so. So, the more consistent way of doing it is to simply declare a const
> value of the right type initialized to one.

  Other than the current implementation imposes why did you chose the limit
of 64 servers? (i.e. did you do any quantitative estimate that gave that
as the order of magnitude at which partitioning the system made sense?)

  As you pointed out a number of times the hardware/resources on the redirector 
shouldn't be an issue for the olbd. There is presumably some amount of extra
network traffic, but that also shouldn't count too much. The size (in memory)
of the cache presumably grows as many things (e.g. number of clients opening
files, etc.) but not obviously as the number of data servers and this also
isn't a huge issue these days. What else scales with the number of server 
olbd's?

                                   Pete


> On Tue, 14 Sep 2004, Stephen J. Gowdy wrote:
> 
> > Isn't there some suffix like L to add instead of doing a cast?
> >
> > On Tue, 14 Sep 2004, Andrew Hanushevsky wrote:
> >
> > > Hi Pete,
> > >
> > > Problem solved. This is a compiler bug. Well, let's say it wasn't
> > > specified correctly in the ANSI standard and you wind up with a bug. The
> > > details are:
> > >
> > > long long x;
> > >
> > > x = 1<<y;
> > >
> > > will be interpreted by the compiler to mean
> > >
> > > x = 1 << (y % (sizeof(1)*sizeof(char)));
> > >
> > > Well, sizeof(1) is 4 since it's an int; so shifts greater than 32 will
> > > wrap. That's the bug. The claim is that the compiler errored because it
> > > should have promoted 1 to a long long and it doesn't. The same is true in
> > > Sun CC as well as g++. This bug has been reported but apparently no one
> > > has seen fit to fix it yet (as far as I can tell there is disagreement on
> > > what the standard really meant).
> > >
> > > The solution is to forcibly cast "1" to a long long, sigh. I will fix this
> > > and commit. I hope no one coded this in BaBar code.
> > >
> > > Andy
> > >



-------------------------------------------------------------------------
Peter Elmer     E-mail: [log in to unmask]      Phone: +41 (22) 767-4644
Address: CERN Division PPE, Bat. 32 2C-14, CH-1211 Geneva 23, Switzerland
-------------------------------------------------------------------------