Re: postgresql and process titles - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: postgresql and process titles
Date
Msg-id 20060614203759.GJ4748@svana.org
Whole thread Raw
In response to Re: postgresql and process titles  ("Jim C. Nasby" <jnasby@pervasive.com>)
Responses Re: postgresql and process titles  ("Jim C. Nasby" <jnasby@pervasive.com>)
List pgsql-hackers
On Wed, Jun 14, 2006 at 03:21:55PM -0500, Jim C. Nasby wrote:
> One idea would be to keep something akin to a FIFO, where the backend
> would write records instead of updating/over-writing them, and the
> reader process would only read records where there was no risk that they
> were still being written. That would mean that the reader would need to
> stay at least one record behind the backend, but that's probably
> manageable.

The problem with a FIFO is that the pointers controlling where the
start/end are become the contention.

The only thing I can think of is to have the backends only write atomic
types and give each backend their own cache-line. The profiler would
simply wake up every N ms and read each value, accumulating them
somewhere.

No locking and there would be a maximum of one cache-line bounce per
backend per N ms. I'm not sure you can get better than that under the
situation.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

pgsql-hackers by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: postgresql and process titles
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Alternative variable length structure