Re: [HACKERS] Threads vs Processes

From: Shridhar Daithankar <shridhar_daithankar(at)persistent(dot)co(dot)in>
To: pgsql-hackers(at)postgresql(dot)org
Cc: pgsql-hackers-win32(at)postgresql(dot)org
Subject: Re: [HACKERS] Threads vs Processes
Date: 2003-09-26 14:58:00
Message-ID: 200309262028.00180.shridhar_daithankar@persistent.co.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-hackers-win32

On Friday 26 September 2003 20:19, Tom Lane wrote:
> Shridhar Daithankar <shridhar_daithankar(at)persistent(dot)co(dot)in> writes:
> > We really don't need threads to replace existing functionality. That
> > would be dog work.
>
> No, that's not the point at all. The problem we are facing at the
> moment with the Windows port is lack of fork(), which means there's
> no way for separate-subprocess backends to inherit variable values
> from the postmaster. Bruce has been trying to fix that by having the
> subprocesses somehow reload or re-deduce all those variables; which
> is messy, bug-prone, and probably race-condition-prone too. In a
> threaded implementation it would maybe be relatively easy to initialize
> a new thread's TLS by copying the postmaster thread's TLS, in which case
> a whole pile of as-yet-unwritten Windows-only code won't be needed.

Umm.. I understand child process created by createProcess does not inherit
variable values from parent process. That's where problem originates..

We can simply create a registry key that would contain shared memory id from
where a child process should get the variable values.

And that would need initialization function I talked about earlier. And since
anyways TLS->TLS copy is still needed anyways, I think this approach can
still save us dealing with threads.

God.. it doesn't get any less messy..I hope this is of some value..

Shridhar

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-09-26 15:01:34 initdb failure (was Re: [GENERAL] sequence's plpgsql)
Previous Message Tom Lane 2003-09-26 14:52:13 Re: [ADMIN] postgres 6.2 vacuum

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Merlin Moncure 2003-09-26 15:43:27 Re: [HACKERS] Threads vs Processes
Previous Message Tom Lane 2003-09-26 14:49:16 Re: [HACKERS] Threads vs Processes