Subject: Re: ports

From: [email-masked] (Donn Seeley)
Date: Tue, 24 Aug 93 20:12:05 -0400

From: [email-masked] (Paul M. Aoki)
	To: Mike Olson <[email-masked]>
	Cc: [email-masked] (Donn Seeley)
	Subject: Re: ports 
	Date: Wed, 11 Aug 93 12:12:31 -0700

	Mike Olson <[email-masked]> writes:
	> > Thanks for the info...  Looks like we'll still have to
	> > implement those ugly System V IPC interfaces.  If you have
	> > some opinions about how to emulate System V semaphores
	> > under BSD, let me know.
	> if the hardware supports spinlocks, postgres will use those
	> rather than sysv semaphores.  i suspect the 80x86 family
	> doesn't support spinlocks.

	i was assuming that was the case -- nobody ever did spinlocks
	for our sequent box -- but i just looked and the 386 does
	have a test-and-set instruction..  :-P  ok, so i lied.
	given a shared memory emulation package (which we do not
	have right now) you could use also write a postgres spinlock
	package for 80x86 (where x>2) (which we also do not have
	right now).

	> there's an algorithm (i think called baker's algorithm)
	> for guaranteeing mutex completely at user level.  it's
	> probably in cormen, leiserson, and rivest.

	wow.  don't remember anything like that.. brian bershad
	had a paper in a recent asplos on efficient mutex on
	uniprocessors.

I have a user-mode implementation of System V shared memory with
mmap(), but it sorta seems a waste to code postgres to use it rather
than have it use mmap when the latter is available :-).  (The shm*
emulation is part of our System V binary emulator, which is under
development.)  BTW, the Bershad locking hack only works in the
kernel, as I understand it -- it relies on pre-emption.

Donn