Re: using database for queuing operations?

From: John Sidney-Woollett <johnsw(at)wardbrook(dot)com>
To: "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
Cc: pgsql-general(at)postgresql(dot)org, Jeff Amiel <jamiel(at)istreamimaging(dot)com>
Subject: Re: using database for queuing operations?
Date: 2004-09-22 21:21:38
Message-ID: 4151ECE2.7020204@wardbrook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'd have to sit down and think about the answer to that and I'm too
tired right now... ;)

We found the NOWAIT option very useful for helping to get our stored
procedures to behave in a more deterministic way, especially in a
multi-threaded environment.

John Sidney-Woollett

Jim C. Nasby wrote:

> Ahh, yes, forgot about that. Very handy to have. But even without that
> you wouldn't have a race condition, just a blocked process, right?
>
> On Tue, Sep 21, 2004 at 07:15:08AM +0100, John Sidney-Woollett wrote:
>
>>Oracle also has the NOWAIT option for use with the SELECT ... FOR UPDATE
>>query. If the record is locked, the NOWAIT causes the query to generate
>>an exception (rather than blocking) which can then be caught and handled
>>- it helps prevent race conditions. A very nice feature!
>>
>>John Sidney-Woollett
>>
>>Jim C. Nasby wrote:
>>
>>>What's the race in the SELECT FOR UPDATE?
>>>
>>>BTW, this is one nice thing about Oracle... it comes with a built-in
>>>queuing mechanism. It would probably be worth trying to write a generic
>>>queuing system and stick it in Gborg.
>>>
>>>Incidentally, Oracle also supports user-named locks, which would
>>>probably make this easier to do. LOCK TABLE works, but it's more brute
>>>force than is needed. Unfortunately, I don't see a way to simply add
>>>such a thing onto PostgreSQL without adding it to the core.
>>
>>---------------------------(end of broadcast)---------------------------
>>TIP 3: if posting/reading through Usenet, please send an appropriate
>> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
>> message can get through to the mailing list cleanly
>>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2004-09-22 21:28:01 Re: download documentation as HTML (not PDF)
Previous Message Greg Donald 2004-09-22 21:19:55 Re: download documentation as HTML (not PDF)