Re: Reasoning behind process instead of thread based

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Reasoning behind process instead of thread based
Дата
Msg-id 20041027180931.GD17293@svana.org
обсуждение исходный текст
Ответ на Re: Reasoning behind process instead of thread based  (nd02tsk@student.hig.se)
Ответы Re: Reasoning behind process instead of thread based  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Wed, Oct 27, 2004 at 07:47:03PM +0200, nd02tsk@student.hig.se wrote:
> >Two:  If a
> > single process in a multi-process application crashes, that process
> > alone dies.  The buffer is flushed, and all the other child processes
> > continue happily along.  In a multi-threaded environment, when one
> > thread dies, they all die.
>
>
> So this means that if a single connection thread dies in MySQL, all
> connections die?
>
> Seems rather serious. I am doubtful that is how they have implemented it.

It's part of the design of threads. If a thread does an invalid lookup,
it's the *process* (ie all threads) that receives the signal and it's
the *process* that dies.

Just like a SIGSTOP stops all threads and a SIGTERM terminates them
all. 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.

And indeed, the one MySQL server I can see is four threads. Nasty.
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Newbie question about casting literals - oracle/postgres
Следующее
От: Thomas Hallgren
Дата:
Сообщение: Re: Reasoning behind process instead of thread based