Skip site navigation (1) Skip section navigation (2)

Re: Using Threads?

From: Adam Haberlach <adam(at)newsnipple(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Using Threads?
Date: 2000-12-04 23:17:00
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Mon, Dec 04, 2000 at 02:28:10PM -0600, Bruce Guenter wrote:
> 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?

	Typically (on a well-written OS, at least), the spawning of a thread
is much cheaper then the creation of a new process (via fork()).  Also,
since everything in a group of threads (I'll call 'em a team) shares the
same address space, there can be some memory overhead savings.

Adam Haberlach           |"California's the big burrito, Texas is the big
adam(at)newsnipple(dot)com      | taco ... and following that theme, Florida is| the big tamale ... and the only tamale that 
'88 EX500                | counts any more." -- Dan Rather 

In response to


pgsql-hackers by date

Next:From: Bruce GuenterDate: 2000-12-04 23:17:04
Subject: Re: Using Threads?
Previous:From: Jan WieckDate: 2000-12-04 23:01:46
Subject: Re: 8192 BLCKSZ ?]

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group