Re: New to concurrency

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: New to concurrency
Дата
Msg-id 20070407111341.GA28829@svana.org
обсуждение исходный текст
Ответ на New to concurrency  ("John D. Burger" <john@mitre.org>)
Список pgsql-general
On Fri, Apr 06, 2007 at 08:03:42PM -0400, John D. Burger wrote:
> For the first time, I find myself wanting to use some of PG's
> concurrency control stuff, and I could use some advice.
>
> I have requests showing up in a database, and I have one or more
> servers picking these up with listen/notice.  The requests go into a
> table with a status column, which is initially NULL, so a server
> finds requests to process like so:

There's been some discussion about this earlier on these list, I
suggest you try google. In any case, from memory the issues are as
follows:

1. SELECT FOR UPDATE is enough, except you have to handle the case that
sometimes the query will return no rows even though there is work to
do.
2. If you have multiple programs reading the queue, they will conflict
with eachother, various ways were described to handle that.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Вложения

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

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: performance; disk bad or something?
Следующее
От: Marcus Engene
Дата:
Сообщение: Re: performance; disk bad or something?