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: 20001204151659.A30808@ricochet.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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
http://www.newsnipple.com| the big tamale ... and the only tamale that
'88 EX500 | counts any more." -- Dan Rather

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Guenter 2000-12-04 23:17:04 Re: Using Threads?
Previous Message Jan Wieck 2000-12-04 23:01:46 Re: 8192 BLCKSZ ?]