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


Reply via email to