Re: [HACKERS] S_LOCK() change produces error... - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] S_LOCK() change produces error...
Date
Msg-id 199801201937.OAA06493@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] S_LOCK() change produces error...  (Bruce Momjian <maillist@candle.pha.pa.us>)
List 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

pgsql-hackers by date:

Previous
From: James Hughes
Date:
Subject: Authentication Woes
Next
From: The Hermit Hacker
Date:
Subject: Re: [HACKERS] Authentication Woes