distributedlog-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sijie Guo (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DL-138) Improve the 'synchronized' usage
Date Tue, 13 Dec 2016 01:36:58 GMT
Sijie Guo created DL-138:
----------------------------

             Summary: Improve the 'synchronized' usage 
                 Key: DL-138
                 URL: https://issues.apache.org/jira/browse/DL-138
             Project: DistributedLog
          Issue Type: Task
            Reporter: Sijie Guo


{quote}
191 Methods are synchronized using the ‘synchronized’ modifier in the declaration. It
is not a good programming practise to use this modifier at method level. Normally, it is more
recommendable to implement synchronized code blocks inside methods. The reason is very simple.
If other people modify these methods later, it will not be easy for them to realise that the
entire method is synchronized. They will surely expand the method with code that is not necessary
to synchronize. In the long term, the application will become more and more linear in execution,
taking way less advantage of the hardware resources, and will be slower.
{quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message