I did some very rudimentary performance testing on "the pipe model" vs
"the event and shared mem model".
When using the Connx code right off, named pipes were significantly
faster. This is because of the Sleep(100) call that was in the Connx
However, when switching to using two events and one shared memory
section (one event signalling in each direction, so WaitForSingleObject
with an actual timeout can be used instead of a manual loop with a Sleep
call in it), using this method was almost 20 times faster than using
I don't know how performance critical this part is, but it's a
significant enough difference to think about, I think.
On a sidenote, I don't think the Connx code right off is secure against
two clients hitting the same backend with a signal at the same time.
There is a (very small) window where they might conflict, since the
shared memory is not protected by a mutex. But this is easily fixed.
Named pipes are automatically synchronized, so this problem does not
appear in that scenario.
pgsql-hackers-win32 by date
|Next:||From: Tom Lane||Date: 2003-12-17 14:56:49|
|Subject: Re: [HACKERS] [PATCHES] fork/exec patch |
|Previous:||From: Magnus Hagander||Date: 2003-12-17 10:03:08|
|Subject: Re: [HACKERS] [PATCHES] fork/exec patch|