Re: Threads vs Processes (was: NuSphere and PostgreSQL for window s) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Threads vs Processes (was: NuSphere and PostgreSQL for window s)
Date
Msg-id 9297.1064502018@sss.pgh.pa.us
Whole thread Raw
In response to Re: Threads vs Processes (was: NuSphere and PostgreSQL for window  (Claudio Natoli <claudio.natoli@memetrics.com>)
Responses Re: Threads vs Processes
Re: Threads vs Processes (was: NuSphere and PostgreSQL
List pgsql-hackers
Claudio Natoli <claudio.natoli@memetrics.com> writes:
>> How are you dealing with the issue of wanting some static variables to
>> be per-thread and others not?

> To be perfectly honest, I'm still trying to familiarize myself with the code
> sufficiently well so that I can tell which variables need to be per-thread
> and which are shared (and, in turn, which of these need to be protected from
> concurrent access).

Well, the first-order approximation would be to duplicate the current
fork semantics: *all* static variables are per-thread, and should be
copied from the parent thread at thread creation.  If there is some
reasonably non-invasive way to do that, we'd have a long leg up on the
problem.

            regards, tom lane

pgsql-hackers by date:

Previous
From: Claudio Natoli
Date:
Subject: Re: Threads vs Processes (was: NuSphere and PostgreSQL for window
Next
From: Greg Stark
Date:
Subject: Re: [pgsql-www] NuSphere and PostgreSQL for windows