Re: Threads vs processes - The Apache Way (Re: Path to PostgreSQL

From: mlw <markw(at)mohawksoft(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert <robert(at)robert(dot)cz>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Threads vs processes - The Apache Way (Re: Path to PostgreSQL
Date: 2002-05-10 16:55:42
Message-ID: 3CDBFB8E.D508EA16@mohawksoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
>
> mlw <markw(at)mohawksoft(dot)com> writes:
> > Without some buy-in from the core team, I'm not sure I am willing to spend my
> > time on it. If someone would be willing to fund the 100 or so man-hours
> > required to do it, then that would be a different story.
>
> You are not going to get any buy-in with such ridiculous claims as that.
> If the total cost of a native Windows port were O(100 hours), it'd have
> been done long since. Add a couple zeroes on the end and I'd start to
> believe that you might have some grasp of the problem.

I was basing my estimates on a couple things. Please feel free to correct me
where I'm wrong. Dann Corbit mentioned a number of, I think I recall, a couple
hundred man-hours for their port.

My approach would be to find all the global variables setup by postmaster, not
all the globals, mind you. Just the ones initialized by postmaster. Move them
to a structure. That structure would be capable of being copied to the child
process.

In the area where forking the postgres process happens, I would ifdef that area
with an "HAS_FORK" The Windows portion would use CreateProcess. The Windows
version of postgres would contact the postmaster and get its copy of the
globals struct. The code to transfer ownership of sockets, files, and memory
would have to be written also.

I would only minimally change the back-end code, it would still be built with
cygwin tools only directed not to link against the cygwin.dll. (The same goes
for the utilities as well.)

A thin port layer could then be constructed by either implementing sysv/UNIX
replacements, or a more simple API as needed in the code, like your shared
memory and semaphore APIs.

Does that sound like an unworkable plan?

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 2002-05-10 17:05:33 Re: the parsing of parameters
Previous Message Joel Burton 2002-05-10 16:51:41 Re: FW: Cygwin PostgreSQL Information and Suggestions