jakarta-slide-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Hartmeier <Michael.Hartme...@softwareag.com>
Subject Re: T-Locking and Resolving
Date Tue, 06 Jan 2004 15:57:47 GMT
Aaaarghhh! Your code looks definitely better than mine ...

Where did you checkin your GenericLock? We should change ParentStore to
use your lock (or even better: use a common lock manager).

Michael

On Tue, 2004-01-06 at 16:31, Oliver Zeigermann wrote:
> Arghhh! After investigating both TLock and GenericLock for comparison it 
>   occurs to me *both* "acquire" methods are wrong as they use the wrong 
> timeout in wait.
> 
> In TLock the timeout may be too *short* when the loop cicles more than 
> once while in GenericLock the timeout may be too *long* as wait always 
> waits the maximum timeout.
> 
> To solve this the for loop in awaitReader and awaitWriter in TLock might 
> look like this:
> 
> >         for (remaining = timeout; remaining > 0; remaining = timeout - (System.currentTimeMillis()
- started)) {
> 
> instead of the current loop
> 
> >         for (remaining = timeout; remaining > 0; remaining -= System.currentTimeMillis()
- started) {
> 
> 
> As I obviously failed once in this task that seemed so simple to me I 
> may be wrong here again. Could someone smarter than me check this, please :)
> 
> Oliver



---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org


Mime
View raw message