Re: Using Threads? - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Using Threads?
Date
Msg-id 200012090520.AAA14626@candle.pha.pa.us
Whole thread Raw
In response to Re: Using Threads?  (Bruce Guenter <bruceg@em.ca>)
List pgsql-hackers
-- Start of PGP signed section.
> On Mon, Nov 27, 2000 at 11:42:24PM -0600, Junfeng Zhang wrote:
> > 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?
> 
> Once all the questions regarding "why not" have been answered, it would
> be good to also ask "why use threads?"  Do they simplify the code?  Do
> they offer significant performance or efficiency gains?  What do they
> give, other than being buzzword compliant?

Good question.  I have added this to the developers FAQ:

---------------------------------------------------------------------------

14) Why don't we use threads in the backend?

There are several reasons threads are not used:
    Historically, threads were unsupported and buggy.     An error in one backend can corrupt other backends.     Speed
improvementsusing threads are small compared to the      remaining backend startup time.     The backend code would be
morecomplex. 
 

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Using Threads?
Next
From: Bruce Momjian
Date:
Subject: Re: Using Threads?