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

Re: Using Threads?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: The Hermit Hacker <scrappy(at)hub(dot)org>
Cc: Junfeng Zhang <junfengz(at)cae(dot)wisc(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Using Threads?
Date: 2000-12-04 20:29:19
Message-ID: 6701.975961759@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
The Hermit Hacker <scrappy(at)hub(dot)org> writes:
>> Why not use threads instead? Is that just for a
>> historical reason, or some performance/implementation concern?

> Several reasons, 'historical' probably being the strongest right now
> ... since PostgreSQL was never designed for threading, its about as
> 'un-thread-safe' as they come, and cleaning that up will/would be a
> complete nightmare (should eventually be done, mind you) ...

> The other is stability ... right now, if one backend drops away, for
> whatever reason, it doesn't take down the whole system ... if you ran
> things as one process, and that one process died, you just lost your whole
> system ...

Portability is another big reason --- using threads would create lots
of portability headaches for platforms that had no threads or an
incompatible threads library.  (Not to mention buggy threads libraries,
not-quite-thread-safe libc routines, yadda yadda.)

The amount of work required looks far out of proportion to the payoff...

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2000-12-04 20:35:47
Subject: Re: Wrong FOR UPDATE lock type
Previous:From: Bruce GuenterDate: 2000-12-04 20:28:10
Subject: Re: Using Threads?

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