List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:July 28 1999 4:39pm
Subject:Re: On GET_LOCK ()
View as plain text  
At 8:48 AM -0500 7/28/99, <sinisa@stripped> wrote:
>Benjamin Pflugmann writes:
> > Hi.
> >
> > > What do you think that I suggest to Monty that we add a NON_WAIT
> > > option to the get_lock, which would not hang, but would return 0 if a
> > > lock is struck. In that case, a programmer could check the return code
> > > and inform the user that a resource is unavailable .....
> >
> > Either I totally misunderstand you or you are talking about
> > GET_LOCK('foo',0), which is already available and will return 0 in
> > case of an existing lock...?
> >
> > Bye,
> >
> >         Benjamin.
> >
>
>Yes, you are partially right.
>
>'0' is returned when lock has passed it's timeout, which in case of
>'0' means always.

Are you saying the GET_LOCK() call will fail to obtain the lock i
you specify a timeout value of 0?  That isn't so.  If the lock is
available, GET_LOCK() will succeed.  If not, GET_LOCK() will return
0.  In both cases it returns immediately.  It seems to me this is
a perfectly adequate way of "polling" for a lock.

>
>No, there should be then some other value, like '2' or '-1' for non
>wait locks

I think I need to see an example of where this is needed.  I'm not
sure I understand why GET_LOCK(name,0) doesn't do what's required.

--
Paul DuBois, paul@stripped
Thread
Restrict Accesstoxalot27 Jul
  • Restrict Accesssinisa27 Jul
    • Re: Restrict AccessThimble Smith27 Jul
      • Re: Restrict AccessPaul DuBois27 Jul
        • Re: Restrict AccessMartin Ramsch27 Jul
          • Re: Restrict AccessPaul DuBois28 Jul
            • Re: Restrict AccessThimble Smith28 Jul
        • Re: Restrict Accesssinisa28 Jul
    • Re: Restrict Accesstoxalot28 Jul
      • On GET_LOCK ()sinisa28 Jul
        • Re: On GET_LOCK ()Benjamin Pflugmann28 Jul
          • Re: On GET_LOCK ()sinisa28 Jul
            • Re: On GET_LOCK ()Paul DuBois28 Jul
          • Re: On GET_LOCK ()Jim Faucette28 Jul
            • Re: On GET_LOCK ()Paul DuBois28 Jul
              • Re: On GET_LOCK ()Thimble Smith28 Jul
          • Re: On GET_LOCK ()Gerald Clark28 Jul
        • Re: On GET_LOCK ()Paul DuBois28 Jul
          • Re: On GET_LOCK ()sinisa28 Jul
            • Re: On GET_LOCK ()Paul DuBois28 Jul
  • Re: On GET_LOCK ()Scott Hess28 Jul
    • getting rid of duplicatesJoel Bremson28 Jul
    • Re: getting rid of duplicatesChristian Mack28 Jul
    • Re: On GET_LOCK ()sinisa29 Jul
      • Re: On GET_LOCK ()Paul DuBois29 Jul
    • Re: On GET_LOCK ()Scott Hess29 Jul
Re: On GET_LOCK ()toxalot28 Jul
  • Re: On GET_LOCK ()sinisa28 Jul
    • Re: On GET_LOCK ()Benjamin Pflugmann29 Jul
  • Re: On GET_LOCK ()Sasha Pachev29 Jul
    • Re: On GET_LOCK ()Benjamin Pflugmann31 Jul
Re: On GET_LOCK ()Thimble Smith29 Jul
  • Re: On GET_LOCK ()Fraser MacKenzie29 Jul
    • Re: On GET_LOCK ()Thimble Smith29 Jul
      • Re: On GET_LOCK ()Fraser MacKenzie29 Jul
Re: On GET_LOCK()R. Mentink31 Jul