Skip site navigation (1) Skip section navigation (2)

Re: Committing Resources to Win32

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Marsh Ray <marsh-pg(at)mysteray(dot)com>
Cc: pgsql-hackers-win32(at)postgresql(dot)org
Subject: Re: Committing Resources to Win32
Date: 2003-11-12 03:35:56
Message-ID: (view raw, whole thread or download thread mbox)
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.

Agreed, threads have helped Apache under Windows, but it doesn't seem to
be buying them much under Unix, so then we have to wonder whether adding
the cruft to the source tree is worth it.

Right now I have done stuff that is needed under Win32 wether we use
thread or CreateProcess, and in fact once I have fork/exec work under
Unix (and then Win32 CreateProcess), all the code will be marked as
EXEC_BACKEND so we can come back later if we need to remove it.

  Bruce Momjian                        |
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

pgsql-hackers-win32 by date

Next:From: Bruce MomjianDate: 2003-11-12 04:05:20
Subject: Re: Committing Resources to Win32
Previous:From: Bruce MomjianDate: 2003-11-12 03:33:19
Subject: Re: Committing Resources to Win32

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group