Re: cvs head initdb hangs on unixware - Mailing list pgsql-hackers

From Tom Lane
Subject Re: cvs head initdb hangs on unixware
Date
Msg-id 16881.1228842180@sss.pgh.pa.us
Whole thread Raw
In response to Re: cvs head initdb hangs on unixware  (ohp@pyrenet.fr)
List pgsql-hackers
ohp@pyrenet.fr writes:
> On Tue, 9 Dec 2008, Tom Lane wrote:
>> Hmm, so the problem is in that second loop.  The trick is to pick some
>> reasonably non-ugly code change that makes the problem go away.

>    I tried that and moving leftok,rightok declaration outside the loop, and 
> refactor the assignement code of leftok, rightok . nothing worked!

I was afraid of that.  We'd need to look at the assembly code to be sure
(can you provide it?), but what I bet is happening is that the compiler
is looking at the leftnodeno/rightnodeno computations and thinking it can
optimize those by a strength-reduction method, failing to notice that
the loop isn't a simple scan on nodeno.

Now in that regard the logic isn't very much different from a binary
search, which we have lots of and those have always worked.  So I'm
back to the theory that the goto inside the inner loop is probably
contributing to the confusion somehow.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Kenneth Marshall
Date:
Subject: Re: cvs head initdb hangs on unixware
Next
From: Andrew Chernow
Date:
Subject: Re: parallel restore vs. windows