At 10:29 AM 6/24/2003 -0700, Mark Womack wrote:
Ceki,

I made the changes in PluginRegistry, but I still need to test it out.  I
like the use of ReaderWriterLock.  It is going to be better than the
synchronized blocks I had before.

A ReaderWriterLock can be used to protect a resource if all of the following conditions are met:

1) Frequent read operations on the resource
2) Rare write operations on the resource
3) Read operations called by many distinct threads simultaneously

Note that all these conditions are met for the root logger in a logger
hierarchy. Its state is read frequently, it is only rarely
modified. The third condition is observed in many J2EE applications
using log4j and serving many clients simultaneously. Actually, it has
been a frequent request by many of the larger institutions using
log4j.

For the PluginRegistry, it seems to me that the third condition is
not. If that is true, then there is no gain in using this type of
fancy lock.

Enjoy your vacations,

-Mark

--
Ceki For log4j documentation consider "The complete log4j manual"
ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to