Re: Reasoning behind process instead of thread based - Mailing list pgsql-general

From Tom Lane
Subject Re: Reasoning behind process instead of thread based
Date
Msg-id 24581.1098909394@sss.pgh.pa.us
Whole thread Raw
In response to Re: Reasoning behind process instead of thread based  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: Reasoning behind process instead of thread based  (Thomas Hallgren <thhal@mailblocks.com>)
List pgsql-general
Martijn van Oosterhout <kleptog@svana.org> writes:
> ... Signals are shared between threads. Now, you could ofcourse catch
> these signals but you only have one address space shared between all
> the threads, so if you want to exit to get a new process image (because
> something is corrupted), you have to close all connections.

Right.  Depending on your OS you may be able to catch a signal that
would kill a thread and keep it from killing the whole process, but
this still leaves you with a process memory space that may or may not
be corrupted.  Continuing in that situation is not cool, at least not
according to the Postgres project's notions of reliable software design.

It should be pointed out that when we get a hard backend crash, Postgres
will forcibly terminate all the backends and reinitialize; which means
that in terms of letting concurrent sessions keep going, we are not any
more forgiving than a single-address-space multithreaded server.  The
real bottom line here is that we have good prospects of confining the
damage done by the failed process: it's unlikely that anything bad will
happen to already-committed data on disk or that any other sessions will
return wrong answers to their clients before we are able to kill them.
It'd be a lot harder to say that with any assurance for a multithreaded
server.

            regards, tom lane

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Reasoning behind process instead of thread based
Next
From: Bruno Wolff III
Date:
Subject: Re: Bug or stupidity