mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dawie Malan" <dawie.ma...@mxit.com>
Subject RE: Interesting blog entry about synchronized vs ReentrantLock
Date Wed, 16 May 2007 07:57:11 GMT
Click here to view our e-mail legal notice: 
http://www.mxit.co.za/pdfs/mxit_legal.pdf or call: +27 21 888 7000

We've replaced all 'synchronized' keywords with ReentrantLock in our proxy
server code after extensive profiling, and it did have a performance benefit
(for our application's conditions anyway).

While the synchronized keyword was optimized quite a lot, this is only true for
JDK6. Until JBoss5 is released we can't move to JDK6.

However, we are achieving 20K socket connections and 60K packets per second (per
server) with Mina 1.1, and profiling has shown that Mina is still not the
bottleneck - if we can process packets faster with less CPU overhead we will
achieve even higher throughput.

In my opinion changing Mina to use ReentrantLock will have benefits for JDK5
users, but whether it will make enough of a difference to justify the effort is
doubtful, unless not much effort is required to make the change.


-----Original Message-----
From: Trustin Lee [mailto:trustin@gmail.com] 
Sent: Wednesday, May 16, 2007 8:46 AM
To: dev@mina.apache.org
Subject: Interesting blog entry about synchronized vs ReentrantLock


I found an interesting blog entry:


It seems like Sun engineers have done a lot of optimization on
'synchronized' keyword.  I just have been thinking that ReentrantLock
performs better than synchronized like this article points out:


So, should we stick to synchronized as long as we don't need advanced
features of ReentrantLock for MINA?

what we call human nature is actually human habit
PGP Key ID: 0x0255ECA6

View raw message