cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Berin Loritsch" <blorit...@apache.org>
Subject RE: [Bug?] Cocoon MRUStore not synchronized
Date Tue, 26 Mar 2002 14:02:07 GMT
With a method like that, we have to ensure that it is called by
only one thread.  If the code snippet you have below is called
by every thread accessing the MRUStore, then it should be synchronized.
However, that will slow down the Cache to the point where it would
be cheaper to not have it.

It would be better to ensure that the method that contains that snippet
only be called by a controlling thread--where you can be assured that
there is only one thread, and that the snippet no longer needs
explicit synchronization.

Remember, uncontended synchronization is cheap--but contended
synchronization
is expensive.  Control code should be done asynchronously from the rest
of the system, and only by one thread.

> -----Original Message-----
> From: Carsten Ziegeler [mailto:cziegeler@s-und-n.de] 
> Sent: Tuesday, March 26, 2002 8:53 AM
> To: Cocoon-Dev
> Subject: [Bug?] Cocoon MRUStore not synchronized
> 
> 
> Hi Team,
> 
> after investigating a little bit in some lockups I found out 
> that the MRUStore is not synchronized. Is this by intention?
> 
> It seems that under high load and with a little bit of luck 
> all threads hang in this loop in the hold() method:
> 
> while (this.mrulist.size() >= this.maxobjects) {
>             /** ...ok, heapsize is reached, remove the last 
> element... */
>             this.free();
> }
> 
> This is only an assumption. Anyone if this might be possible 
> with let's say 100 concurrent threads?
> 
> Carsten
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message