Re: Threading in BGWorkers (!)

Поиск
Список
Период
Сортировка
От James Sewell
Тема Re: Threading in BGWorkers (!)
Дата
Msg-id CAANVwEvRTK2EXa8e5wg6pEj+LyAv8u3SD+xDJNm=vc2eY6N0Pg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Threading in BGWorkers (!)  (Chapman Flack <chap@anastigmatix.net>)
Ответы Re: Threading in BGWorkers (!)  (Thomas Munro <thomas.munro@gmail.com>)
Список pgsql-hackers
Hackers,

In the hope of this not being derailed by larger/more unpopular pieces of work, I'm attaching a tiny patch which I don't believe will have any negative impact - but will remove one blocker for $subject (sigprocmask usage is "unspecified" in multithreaded code [1]).

The patch replaces sigprocmask with pthread_sigmask. They have identical APIs ("[pthread_sigmask] shall be equivalent to sigprocmask(), without the restriction that the call be made in a single-threaded process"[1])

The rationale here is that as far as I can tell this is the *only* blocker to using multithreaded code in a BGWorker which can't be avoided by adhering to strict code rules (eg: no PG calls from non-main threads, no interaction with signals from non-main threads).

Before this went in the rules would need to be agreed upon and documented - but hopefully it's at least a way forward / a way to progress this discussion.

Cheers,
James









The contents of this email are confidential and may be subject to legal or professional privilege and copyright. No representation is made that this email is free of viruses or other defects. If you have received this communication in error, you may not copy or distribute any part of it or otherwise disclose its contents to anyone. Please advise the sender of your incorrect receipt of this correspondence.
Вложения

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: SQL-standard function body
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: A patch for get origin from commit_ts.