Re: Mixing threaded and non-threaded

Поиск
Список
Период
Сортировка
От Scott Lamb
Тема Re: Mixing threaded and non-threaded
Дата
Msg-id 48B27D84-5107-11D8-8133-000A95891440@slamb.org
обсуждение исходный текст
Ответ на Re: Mixing threaded and non-threaded  (Steve Atkins <steve@blighty.com>)
Список pgsql-hackers
On Jan 27, 2004, at 1:16 PM, Steve Atkins wrote:
> A hint, though, might be that it's a multiprocess application with a
> single master process that controls dozens of child processes. When the
> master shuts down it asks all the children to shut down, and then it
> deadlocks in the SIGCHILD handler.

It's not safe to do anything interesting in a SIGCHLD handler, unless  
you have pretty severe restrictions on when the signal can arrive. Take  
a look at  
<http://www.opengroup.org/onlinepubs/007904975/functions/ 
xsh_chap02_04.html>. It contains a list of all the async signal-safe  
functions in SUSv3. It's a pretty short list. Notably absent are  
pthread_mutex_*() and malloc() (and anything that uses them).

Scott Lamb



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

Предыдущее
От: Dennis Bjorklund
Дата:
Сообщение: Re: Function call
Следующее
От: Greg Stark
Дата:
Сообщение: Question about indexes