Re: SLEEP in posgresql

From: "Jasbinder Singh Bali" <jsbali(at)gmail(dot)com>
To: "Richard Huxton" <dev(at)archonet(dot)com>
Cc: "Michal Taborsky - Internet Mall" <michal(dot)taborsky(at)mall(dot)cz>, pgsql-general(at)postgresql(dot)org
Subject: Re: SLEEP in posgresql
Date: 2007-10-10 08:30:42
Message-ID: a47902760710100130m55d5d8bakd626ec4158a3d5b9@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

my loop is a busy wait and keeps iterating until a=b condition is met.
However, it would lead to millions of instructions executing per second.

So to save resources, I want to keep a sleep before re-iterating. Don't
understand how is SLEEP disastrous here even if i don't know when is my loop
going to end

On 10/10/07, Richard Huxton <dev(at)archonet(dot)com> wrote:
>
> Jasbinder Singh Bali wrote:
> > What if its just SLEEP for 1 second. Why would it keep my stored
> procedure
> > hanging ?
>
> Because presumably your loop-condition isn't under your control
> (otherwise you wouldn't need to sleep).
>
> Can you *always* guarantee the condition (a=b) will happen within a
> reasonable time-frame?
>
> --
> Richard Huxton
> Archonet Ltd
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2007-10-10 08:41:34 Re: SLEEP in posgresql
Previous Message Richard Huxton 2007-10-10 08:24:30 Re: SLEEP in posgresql