Re: [HACKERS] Thread-safe queueing?

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] Thread-safe queueing?
Дата
Msg-id 199911140311.WAA10351@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] Thread-safe queueing?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [HACKERS] Thread-safe queueing?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> Alternatively, you could forget about a queue per se, and just allow
> each backend to execute the sending of its own log messages, using
> a spinlock in shared memory to prevent concurrent issuance of log
> messages on channels where that's a problem.  That might be the
> simplest and most robust approach.

Hold on.  Unix guarantees all write() calls are atomic, so no one gets
in between that write.  Why not just collect the output into one buffer
in the backend, and blast the entire buffer in one write() to the log
file.

I don't think there is any way another backend could mess that up.

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Thread-safe queueing?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Thread-safe queueing?