Re: Using Threads?

From: Myron Scott <mscott(at)sacadia(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Using Threads?
Date: 2000-12-04 08:20:20
Message-ID: Pine.GSO.4.10.10012032351040.28161-100000@goldengate.kojoworldwide.com.
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I maybe wrong but I think that PGSQL is not threaded mostly due to
historical reasons. It looks to me like the source has developed over
time where much of the source is not reentrant with many global variables
throughout. In addition, the parser is generated by flex which
can be made to generate reentrant code but is still not thread safe b/c
global variables are used.

That being said, I experimented with the 7.0.2 source and came up with a
multithreaded backend for PGSQL which uses Solaris Threads. It seems to
work, but I drifted very far from the original source. I
had to hack flex to generate threadsafe code as well. I use it as a
linked library with my own fe<->be protocol. This ended up being much much
more than I bargained for and looking back would probably not have tried
had I known any better.

Myron Scott

On Mon, 27 Nov 2000, Junfeng Zhang wrote:

> Hello all,
>
> I am new to postgreSQL. When I read the documents, I find out the Postmaster
> daemon actual spawns a new backend server process to serve a new client
> request. Why not use threads instead? Is that just for a historical reason,
> or some performance/implementation concern?
>
> Thank you very much.
> Junfeng
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zeugswetter Andreas SB 2000-12-04 09:57:05 AW: broken locale in 7.0.2 without multibyte support (F reeBSD 4.1-RELEASE) ?
Previous Message Don Baccus 2000-12-04 08:15:16 Re: beta testing version