Re: LWLock/ShmemIndex startup question

From: Claudio Natoli <claudio(dot)natoli(at)memetrics(dot)com>
To: 'Tom Lane ' <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Claudio Natoli <claudio(dot)natoli(at)memetrics(dot)com>
Cc: "''''pgsql-hackers(at)postgresql(dot)org' ' ' '" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: LWLock/ShmemIndex startup question
Date: 2004-01-13 06:37:09
Message-ID: A02DEC4D1073D611BAE8525405FCCE2B55F25A@harris.memetrics.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane writes:
> [cvs is your friend...] It appears to have been added as part of the
> MinGW porting work last May. I don't have much faith in it; as far as
> I heard the MinGW port never got further than making the client-side
> code work, and so this file has no real-world testing.

FWIW, I've done a code walk-through, and it looks ok (lack of real-world
testing notwithstanding), and actually does use the Win32 sema set. The only
real problem is that it calls ShmemInitStruct in semget, which ultimately
gets us into bootstrap hell (without native spinlocks, at least).

Also, as far as using it in the "hardware independent" version of spin-locks
go, it makes kernel calls, which, as spin.c comments: "is too slow to be
very useful".

> > No chance on getting the Shmem bootrap rearrangement past you, as
> > described in my earlier mail?
>
> I didn't say no chance, I was just questioning the reason.

This was my only reasoning (with the small benefit that it rids us of the
ShmemLock/ShmemIndexLock creation ugliness, for equivalent ShmemBootstrap
ugliness).

Ok, I think having a native win32 spin-lock implementation (say, based on
InterlockedCompareExchange?) is the minimal impact answer. I'll work on
producing that.

Cheers,
Claudio

---
Certain disclaimers and policies apply to all email sent from Memetrics.
For the full text of these disclaimers and policies see
<a
href="http://www.memetrics.com/emailpolicy.html">http://www.memetrics.com/em
ailpolicy.html</a>

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2004-01-13 08:19:15 Re: Reserved words and named function parameters
Previous Message Tom Lane 2004-01-13 05:44:27 Re: LWLock/ShmemIndex startup question