Re: Using Threads?

From: Myron Scott <mscott(at)sacadia(dot)com>
To: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Using Threads?
Date: 2001-01-02 15:43:55
Message-ID: 3A51F73B.3070708@sacadia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Karel Zak wrote:

> On Tue, 2 Jan 2001, Myron Scott wrote:
>
>
>> spinlocks rewritten to mutex_
>> locktable uses sema_
>> some cond_ in bufmgr.c
>
>
> Interesting, have you some comperation between IPC PostgresSQl anf
> your thread based PostgreSQL.
>
> Karel

Yes, I did some comparisions but it is hard to
make accurate evaluations on the data. I basically
did 1000 inserts from 7.0.2 and the modified verison
from 8 simultaneous clients. The original 7.0.2
was faster by an an order of magnitude. This needs to
looked into more though. It was just a rough test b/c clients
and server all running on the same machine (Ultra 10
w/512MB RAM).

I don't really know what the impact of changing some of
the locking mechanisms is.

On the one hand, there is alot of overhead associated
with using TAO ORB as the fe<->be protocol. The 7.0.2
fe<->be is pretty efficient, TAO with IIOP not as much so.
At the same time, using prepared statements when doing
the same insert with different variables over and over
cuts out re-parsing and planning the statement on every
execute.

Lastly, I really didn't optimize my code at all. There
are some places where GetEnv() in called over and over
to get the thread local variable where it should only
be called once in the method and reused.

Speed wasn't the motivation, I just wanted to see if threads
and PostgreSQL could be done.

Myron

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alfred Perlstein 2001-01-02 15:52:34 Re: Using Threads?
Previous Message mlw 2001-01-02 13:31:46 Re: [INTERFACES] Re: PHP and PostgreSQL