Re: Roadmap for a Win32 port

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Igor Kovalenko <Igor(dot)Kovalenko(at)motorola(dot)com>
Cc: Neil Conway <nconway(at)klamath(dot)dyndns(dot)org>, Jon Franz <coventry(at)one(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Roadmap for a Win32 port
Date: 2002-06-06 04:59:36
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Igor Kovalenko wrote:
> I think SGI gets amazing performance because they have very good (efficient)
> synchronization primitives on SGI. Some proprietary light-weight mutexes.
> Using threaded or mixed model just by itself is not going to do a miracle.
> Threads will save you some context switch time, but that will probably
> translate into lower CPU usage rather than performance boost. And if your
> mutexes are not fast or awkwardly implemented (say Linux), it might be even
> worse. Apache is not all that fast on Linux as on SGI, whatever model you
> chose. I also doubt that purely threaded model would be slower than mixed
> one.

Let me throw out an idea. I have been mentioning full fork, light
fork(copy globals only), and threading as possible solutions.

Another idea uses neither threading nor copying. It is the old system
we used before I removed exec() from our code. We used to pass the
database name as an argument to an exec'ed postgres binary that
continued with the database connection.

We removed the exec, then started moving what we could into the
postmaster so each backend didn't need to do the initialization.

One solution is to return to that for Win32 only, so instead of doing:

want for connection()
fork backend()

we do for Win32:

want for connection()
exec backend()

It wouldn't be hard to do. We would still do CreateProcess rather than
CreateThread, but it eliminates the fork/threading issues. We don't
know the database before the connection arrives, so we don't do a whole
lot of initialization.

Bruce Momjian |
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-06-06 05:18:26 Straight-from-the-horses-mouth dept
Previous Message Bruce Momjian 2002-06-06 02:57:00 Re: Roadmap for a Win32 port