Re: modifying the tbale function - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: modifying the tbale function
Date
Msg-id 45FED3F2.10701@dunslane.net
Whole thread Raw
In response to Re: modifying the tbale function  ("Florian G. Pflug" <fgp@phlo.org>)
Responses Re: modifying the tbale function
Re: modifying the tbale function
List pgsql-hackers
Florian G. Pflug wrote:
> Just a thought - I believe that there are portable user-space thread 
> implementations that contain little or no machine-specific code. What
> if postgres used one of those to switch from the PL into the executor
> and back after, say, 1000 rows were returned by the SFR?
>
> What would be needed is basically some enhanced version of setjmp/longjmp
> that actually saves the stack, and not just resets the stackpointer.
>
> Since context switching would occur only at two well-defined places
> (Some return_next_row function that PLs call when a SFR returns a row,
> and in the executor if no more previously returned rows from that SFR
> are available), this wouldn't introduce the usual multithreading
> headache, but still allow to switch in and out of the PL interpreter.
>
>

This just sounds horribly fragile.

Are we really sure that this isn't a solution in search of a problem?

cheers

andrew





pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: alter operator class
Next
From: Bruce Momjian
Date:
Subject: Re: CLUSTER and MVCC