Re: Path to enable a module to change the stack_base_ptr - Mailing list pgsql-patches

From Thomas Hallgren
Subject Re: Path to enable a module to change the stack_base_ptr
Date
Msg-id thhal-0kjoqBFci8rQOzcIPlvH8oxLpABtbBf@mailblocks.com
Whole thread Raw
In response to Re: Path to enable a module to change the stack_base_ptr  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
>
>>> Tom Lane wrote:
>>>
>>>> I'm not really in favor of this ... I think you are trying to make the
>>>> backend do something that will never work reliably.
>>>>
>
>
>> Do we want to make this change for 8.1?
>>
>
> I don't want to do it at all.  The justification given is to allow the
> backend to support multithreading introduced by an add-on library, which
> is a hopeless cause.  Removing "static" from that variable declaration
> is surely a cheap enough change, but what about the next request, and
> the one after that?
>
Tom, I don't request that the backend should support multiple threads
simultaneously. It's one thread at a time. I can't think of a "next
request" in this direction. I'm very aware that the backend is
single-threaded and that you have no intention to change that. Neither do I.

Having the stack_base public is actually useful for another purpose
also. It can allow you to make assertions that check if an abitrary
pointer is 'on stack' or not. The MemoryContextContains() could be made
safer too by just returning false when the given pointer is between the
stack_base and the current stack_pointer. Perhaps that could be added to
the patch?

Regards,
Thomas Hallgren



pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Make 2PC error messages match docs
Next
From: Michael Fuhr
Date:
Subject: Re: Documentation typos