Re: Postgres with pthread - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: Postgres with pthread
Date
Msg-id CAMsr+YESsWGuOZ9tG6tg5YSV-so_i6N6kmB4_p3Ho7V0sAvmNg@mail.gmail.com
Whole thread Raw
In response to Re: Postgres with pthread  (Thomas Munro <thomas.munro@enterprisedb.com>)
Responses Re: Postgres with pthread
List pgsql-hackers
On 7 December 2017 at 05:58, Thomas Munro <thomas.munro@enterprisedb.com> 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.


Yep.

This is the real reason I'm excited by the idea of a threading conversion.

PostgreSQL's architecture conflates "connection", "session" and "executor" into one somewhat muddled mess. I'd love to be able to untangle that to the point where we can pool executors amongst active queries, while retaining idle sessions' state properly even while they're in a transaction.

Yeah, that's a long way off, but it'd be a whole lot more practical if we didn't have to serialize and deserialize the entire session state to do it.

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Postgres with pthread
Next
From: "Tsunakawa, Takayuki"
Date:
Subject: RE: Postgres with pthread