cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <>
Subject Synchronization (was Re: VERY odd exceptions...)
Date Wed, 26 May 2004 13:22:18 GMT
Sylvain Wallez wrote:
> Agree for *variables*. Here, we have a class member, which has to be 
> loaded, then incremented, then stored.
> So as Bertrand, I stay on the safe side and synchronize.
> Sylvain

I understand the desire for more metrics and instrumenting Cocoon so 
that you can get the information you desire, but I have a very serious 
caveat emptor here.  The more synchronization you put into the system 
the less scalability you get.  It comes at a very heavy price.  See my 
blog for a word picture of thread contention:

Keep in mind that the more order you try and impose on a chaotic 
atmosphere the more bottlenecks you introduce.  The contention becomes 
more violent and the overall system slows down.

If you go this route, I highly recommend you place it inside a block 
that does not execute if debugging is not happening.  For example:

if ( getLogger().isDebugEnabled() ) {
	// do synchronized instrumentation

That way in production you do not have to pay the price later.

View raw message