Re: 8.0 beta 1 on linux-mipsel R5900 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: 8.0 beta 1 on linux-mipsel R5900
Date
Msg-id 3292.1093358134@sss.pgh.pa.us
Whole thread Raw
In response to Re: 8.0 beta 1 on linux-mipsel R5900  ("Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at>)
Responses Re: 8.0 beta 1 on linux-mipsel R5900  (Neil Conway <neilc@samurai.com>)
List pgsql-hackers
"Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at> writes:
> I guess it could still save some CPU cycles in the single CPU case,
> if you yield() instead of tight loop around TAS in the failure case.
> Problem is yield and detecting single CPU is not portable.

Sure, but that's still a spinlock --- you're just tuning the backoff
behavior for local conditions.

On some architectures (Alpha at least) the TAS instruction can "fail"
even though the lock is free, if an interrupt happens to get in the way.
So I'd be inclined to loop a few times even on a single-CPU machine.

But yes, a yield primitive would be nice, and so would knowing the
number of CPUs.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [COMMITTERS] pgsql-server: Rearrange pg_subtrans handling
Next
From: Tom Lane
Date:
Subject: Re: missing data/global