| 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 Access | toxalot | 27 Jul |
| • Restrict Access | sinisa | 27 Jul |
| • Re: Restrict Access | Thimble Smith | 27 Jul |
| • Re: Restrict Access | Paul DuBois | 27 Jul |
| • Re: Restrict Access | Martin Ramsch | 27 Jul |
| • Re: Restrict Access | Paul DuBois | 28 Jul |
| • Re: Restrict Access | Thimble Smith | 28 Jul |
| • Re: Restrict Access | sinisa | 28 Jul |
| • Re: Restrict Access | toxalot | 28 Jul |
| • On GET_LOCK () | sinisa | 28 Jul |
| • Re: On GET_LOCK () | Benjamin Pflugmann | 28 Jul |
| • Re: On GET_LOCK () | sinisa | 28 Jul |
| • Re: On GET_LOCK () | Paul DuBois | 28 Jul |
| • Re: On GET_LOCK () | Jim Faucette | 28 Jul |
| • Re: On GET_LOCK () | Paul DuBois | 28 Jul |
| • Re: On GET_LOCK () | Thimble Smith | 28 Jul |
| • Re: On GET_LOCK () | Gerald Clark | 28 Jul |
| • Re: On GET_LOCK () | Paul DuBois | 28 Jul |
| • Re: On GET_LOCK () | sinisa | 28 Jul |
| • Re: On GET_LOCK () | Paul DuBois | 28 Jul |
| • Re: On GET_LOCK () | Scott Hess | 28 Jul |
| • getting rid of duplicates | Joel Bremson | 28 Jul |
| • Re: getting rid of duplicates | Christian Mack | 28 Jul |
| • Re: On GET_LOCK () | sinisa | 29 Jul |
| • Re: On GET_LOCK () | Paul DuBois | 29 Jul |
| • Re: On GET_LOCK () | Scott Hess | 29 Jul |
| • Re: On GET_LOCK () | toxalot | 28 Jul |
| • Re: On GET_LOCK () | sinisa | 28 Jul |
| • Re: On GET_LOCK () | Benjamin Pflugmann | 29 Jul |
| • Re: On GET_LOCK () | Sasha Pachev | 29 Jul |
| • Re: On GET_LOCK () | Benjamin Pflugmann | 31 Jul |
| • Re: On GET_LOCK () | Thimble Smith | 29 Jul |
| • Re: On GET_LOCK () | Fraser MacKenzie | 29 Jul |
| • Re: On GET_LOCK () | Thimble Smith | 29 Jul |
| • Re: On GET_LOCK () | Fraser MacKenzie | 29 Jul |
| • Re: On GET_LOCK() | R. Mentink | 31 Jul |
