From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
---|---|
To: | pgsql-hackers-win32 <pgsql-hackers-win32(at)postgresql(dot)org> |
Subject: | Re: Committing Resources to Win32 |
Date: | 2003-11-07 15:01:38 |
Message-ID: | 3FABB3D2.6080806@dunslane.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers-win32 |
Marsh Ray wrote:
> Claudio Natoli wrote:
>
>>> Specifically, I believe and through conversations with several Win32
>>
>> programmers I know, that using create process is a bad idea and that we
>> should move to a threaded model (at least for Win32).
>>
>> CreateProcess appears to be the method the core developers have decided
>> upon. Unfortunately, and speaking from experience, unless either the
>> decision to use MingW as a build environment is reviewed (as opposed to
>> VC++, for instance), or MingW "soon" supports thread local storage
>> declspecs, a threaded implementation would be just too difficult to
>> integrate cleanly with the existing source base.
>>
> I'm trying to understand this. Is it that the existing code references
> static data in so many places that it impractical to move all that into
> a structures?
>
> You could put a structure high up on the stack of each thread and pass
> down a pointer to it, or use a hash on thread id to reference the data.
> Structuring those globals would probably flush out some, er,
> "undocumented enhancements".
>
> It looks like the Apache group put a lot of work into modularizing their
> execution model for their 2.0.x. It has certainly made their app a
> serious choice under Windows.
I don't think it makes sense to have threading on only one platform from
a common code base. Perhaps a parallel effort needs to be to develop a
threaded version for Unix and see how portable and stable it is, and
then see how we can get that onto Windows.
The TODO list at http://developer.postgresql.org/todo.php has these
items which all seem potentially relevant:
# Experiment with multi-threaded backend [thread
<http://momjian.postgresql.org/cgi-bin/pgtodo?thread>]
# Add connection pooling [pool
<http://momjian.postgresql.org/cgi-bin/pgtodo?pool>]
# Allow persistent backends [persistent
<http://momjian.postgresql.org/cgi-bin/pgtodo?persistent>]
If we are threaded do we still need to use SYSV shared memory?
Threading has all sorts of other wrinkles, too (see recent discussion of
SIGPIPE handling in threaded libpq apps for example).
This URL seems to indicate what is happening with TLS in gcc for w32:
http://gcc.gnu.org/ml/gcc/2003-10/msg00580.html
ISTM that the best plan is to get it working for now with CreateProcess
if possible. If the performance sucks really badly or it is unstable
then we would have to reassess.
cheers
andrew
From | Date | Subject | |
---|---|---|---|
Next Message | Merlin Moncure | 2003-11-07 15:26:24 | Re: Committing Resources to Win32 |
Previous Message | Marsh Ray | 2003-11-07 11:45:49 | Re: Committing Resources to Win32 |