> >> Given this, I'm wondering why we bother with having a separate
> >> XidGenLock spinlock at all.  Why not eliminate it and use SInval
> >> spinlock to lock GetNewTransactionId and ReadNewTransactionId?
> 
> > Reading all MyProc in GetSnashot may take long time - why disallow
> > new Tx to begin.
> 
> Because we need to synchronize?  It bothers me that we're assuming
> that fetching/storing XIDs is atomic.  There's no possibility at all
> of going to 8-byte XIDs as long as the code is like this.
> 
> I doubt that a spinlock per PROC structure would be a better answer,
> either; the overhead of getting and releasing each lock would be
> nontrivial, considering the small number of instructions spent at
> each PROC in these routines.

Isn't spinlock just a few ASM instructions?... on most platforms...

Vadim

Thu, 12 Jul 2001 11:48:27 -0700
"Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
RE: Re: Strangeness in xid allocation / snapshot setup 
"Mikheev, Vadim" <vmikheev@SECTORBASE.COM> writes:
> Isn't spinlock just a few ASM instructions?... on most platforms...

If we change over to something that supports read vs write locking,
it's probably going to be rather more than that ... right now, I'm
pretty dissatisfied with the performance of our spinlocks under load.

			regards, tom lane

Thu, 12 Jul 2001 15:04:02 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: Re: Strangeness in xid allocation / snapshot setup 