Re: [HACKERS] S_LOCK() change produces error...

Bruce Momjian <maillist@candle.pha.pa.us>

From: Bruce Momjian <maillist@candle.pha.pa.us>
To: maillist@candle.pha.pa.us (Bruce Momjian)
Cc: teunis@mauve.computersupportcentre.com, scrappy@hub.org, pgsql-hackers@postgreSQL.org
Date: 1998-01-20T19:37:24Z
Lists: pgsql-hackers
> > (clip from SMP support in linux' asm/spinlocks.h)
> > #define spin_unlock(lock) \
> > __asm__ __volatile__( \
> > 	"lock ; btrl $0,%0" \
> > 	:"=m" (__dummy_lock(lock)))
> > 
> > in linux the lock has ";" following.
> > Yep - it's for multiCPU systems (SMP).  Handy for shared-memory systems
> > too if you're really into multithreading-speed.
> > 
> > It locks that particular byte (word?) of memory against access by other
> > CPU's accessing it IIRC...
> > 
> > Perhaps your GAS is too old?  (GNU binutils)
> > (does BSD support multiple CPU's under intel?)
> > 
> > multiprocessor really isn't that rare under linux - even Linus Torvalds
> > uses a SMP system *grin*...
> > 
> > Maybe he encountered a locking problem with a multicpu host and needed a
> > semaphore (or equiv) to lock things?  Just trying to figure this out...
> > (sometimes necessary if you're doing shared memory across processes)
> 
> Marc, I will try 'lock;'  and if it works, will submit a patch.

Yep, it works.  Patch applied.

-- 
Bruce Momjian
maillist@candle.pha.pa.us