Re: [HACKERS] why do shmem attach?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vadim Mikheev <vadim(at)krs(dot)ru>
Cc: PostgreSQL Developers List <hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] why do shmem attach?
Date: 1999-09-20 14:49:10
Message-ID: 13909.937838950@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Vadim Mikheev <vadim(at)krs(dot)ru> writes:
> Tom Lane wrote:
>> Have I got a deal for you ;-). I have uncommitted changes that add
>> a pointer (SHMEM_OFFSET that is) to each backend's PROC struct into
>> the per-backend info array that already existed in shmem.c.

> Nice. I have new member for PROC that should be searched
> sometime -:)

OK, cool. Easy enough to add now. The reason I did this was that
I added to PROC the OID of the database the backend is attached to,
so that I could make a routine to tell whether any running backends
are connected to a given database. I couldn't quite stomach adding
yet another ShmemIndex-traverser to shmem.c, so...

(I'm sure you can see already where I'm going with that: DESTROY
DATABASE now refuses to destroy a database that has running backends.
I got burnt that way once too often. The interlock against
halfway-started backends was a tad tricky, but I think it works.)

regards, tom lane

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-09-20 14:58:33 Re: [HACKERS] Status on Jan Wieck
Previous Message Tom Lane 1999-09-20 14:36:31 Re: [HACKERS] why do shmem attach?