Re: Spinlock performance improvement proposal

From: Myron Scott <mscott(at)sacadia(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Spinlock performance improvement proposal
Date: 2001-09-26 22:03:00
Message-ID: Pine.GSO.4.10.10109261428340.563-100000@goldengate.kojoworldwide.com.
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 26 Sep 2001, mlw wrote:

> I can only think of two objectives for threading. (1) running the various
> connections in their own thread instead of their own process. (2) running
> complex queries across multiple threads.
>

I did a multi-threaded version of 7.0.2 using Solaris threads about a year
ago in order to try
and get multiple backend connections working under one java process using
jni. I used the thread per connection model.

I eventually got it working, but it was/is very messy ( there were global
variables everywhere! ). Anyway, I was able to get a pretty good speed up
on inserts by scheduling buffer writes from multiple connections on one
common writing thread.

I also got some other features that were important to me at the time.

1. True prepared statements under java with bound input and output
variables
2. Better system utilization
a. fewer Solaris lightweight processes mapped to threads.
b. Fewer open files per postgres installation
3. Automatic vacuums when system activity is low by a daemon thread.

but there were some drawbacks... One rogue thread or bad user
function could take down all connections for that process. This
was and seems to still be the major drawback to using threads.

Myron Scott
mscott(at)sacadia(dot)com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ian Lance Taylor 2001-09-26 22:04:41 Re: Spinlock performance improvement proposal
Previous Message Vince Vielhaber 2001-09-26 21:19:27 Re: casting for dates