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

Re: Using Threads?

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Junfeng Zhang <junfengz(at)cae(dot)wisc(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Using Threads?
Date: 2000-12-04 06:42:58
Message-ID: 3A2B3CF2.88C3E55D@alumni.caltech.edu (view raw or flat)
Thread:
Lists: pgsql-hackers
> 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?

Both. Not all systems supported by PostgreSQL have a standards-compliant
threading implementation (even more true for the systems PostgreSQL has
supported over the years).

But there are performance and reliability considerations too. A
thread-only server is likely more brittle than a process-per-client
implementation, since all threads share the same address space.
Corruption in one server might more easily propagate to other servers.

The time to start a backend is quite often small compared to the time
required for a complete session, so imho the differences in absolute
speed are not generally significant.

                       - Thomas

In response to

Responses

pgsql-hackers by date

Next:From: Don BaccusDate: 2000-12-04 07:01:44
Subject: RE: 8192 BLCKSZ ?]
Previous:From: Don BaccusDate: 2000-12-04 06:32:47
Subject: Re: beta testing version

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