Re: [HACKERS] Current sources?

Tom Ivar Helbekkmo <tih+mail@hamartun.priv.no>

From: Tom Ivar Helbekkmo <tih+mail@Hamartun.Priv.NO>
To: dg@illustra.com (David Gould)
Cc: pgsql-hackers@postgreSQL.org
Date: 1998-05-25T03:26:47Z
Lists: pgsql-hackers
dg@illustra.com (David Gould) writes:

> Try making the 's_lock_test' target in
> src/backend/storage/buffer/Makefile.  It will let you be sure that
> spinlocks are working.

This is how it looks like here (NetBSD/sparc 1.3, GCC 1.7.2.2), with
the broken TAS support replaced with that from SparcLinux:

| barsoom# gmake s_lock_test
| gcc -I../../../include -I../../../backend   -I/usr/local/include -O2 -pipe  -Wall -Wmissing-prototypes -I../.. -DS_LOCK_TEST=1 -g s_lock.c -o s_lock_test
| s_lock.c: In function `main':
| s_lock.c:313: warning: implicit declaration of function `select'
| ./s_lock_test
| S_LOCK_TEST: this will hang for a few minutes and then abort
|              with a 'stuck spinlock' message if S_LOCK()
|              and TAS() are working.
| 
| FATAL: s_lock(00004168) at s_lock.c:324, stuck spinlock. Aborting.
| 
| FATAL: s_lock(00004168) at s_lock.c:324, stuck spinlock. Aborting.
| gmake: *** [s_lock_test] Abort trap (core dumped)
| gmake: *** Deleting file `s_lock_test'
| barsoom# 

...and it did take a couple of minutes (didn't time it, though), so I
guess it works, right?

-tih
-- 
Popularity is the hallmark of mediocrity.  --Niles Crane, "Frasier"