Re: Postgres with pthread - Mailing list pgsql-hackers

From Konstantin Knizhnik
Subject Re: Postgres with pthread
Date
Msg-id [email protected]
Whole thread Raw
In response to Re: Postgres with pthread  (Thomas Munro <[email protected]>)
List pgsql-hackers

On 07.12.2017 00:58, Thomas Munro wrote:
> Using a ton of thread local variables may be a useful stepping stone,
> but if we want to be able to separate threads/processes from sessions
> eventually then I guess we'll want to model sessions as first class
> objects and pass them around explicitly or using a single TLS variable
> current_session.
>
It was my primary intention.
Unfortunately separating all static variables into some kind of session 
context requires much more efforts:
we have to change all accesses to such variables.

But please notice, that from performance point of view access to 
__thread variables is not more expensive then access to static variable or
access to fields of session context structure through current_session.  
And there is no extra space overhead for them.

-- 

Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company



pgsql-hackers by date:

Previous
From: Konstantin Knizhnik
Date:
Subject: Re: Postgres with pthread
Next
From: Alexander Korotkov
Date:
Subject: Re: compress method for spgist - 2