Re: Threading in BGWorkers (!)

Поиск
Список
Период
Сортировка
От Chapman Flack
Тема Re: Threading in BGWorkers (!)
Дата
Msg-id 5EF2B162.9030601@anastigmatix.net
обсуждение исходный текст
Ответ на Re: Threading in BGWorkers (!)  (Andres Freund <andres@anarazel.de>)
Ответы Re: Threading in BGWorkers (!)  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On 06/23/20 21:44, Andres Freund wrote:

> I think that's way harder than what you make it sound here. The locking
> for shm_mq doesn't really work inside a process. In contrast to the
> single threaded case something like a volatile write to
> ParallelMessagePending doesn't guarantee much, because there's no
> guaranteed memory ordering between threads. And more.

It occurred to me after I sent the message this morning that my suggestion
(2) could subsume (1). And requires nothing more than a single volatile
write of a boolean, and getting called back at a convenient time on the
single main thread.

So perhaps I shouldn't have suggested (1) at all - just muddies the waters.

Regards,
-Chap



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Threading in BGWorkers (!)
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Threading in BGWorkers (!)