Skip to content
This repository was archived by the owner on Apr 15, 2018. It is now read-only.

Reduce code path through Synchronized blocks methods #11

Open
sirinath opened this issue Nov 25, 2015 · 1 comment
Open

Reduce code path through Synchronized blocks methods #11

sirinath opened this issue Nov 25, 2015 · 1 comment

Comments

@sirinath
Copy link

When synchronised is used in a multi threaded context there will be always 1 thread in which you can perform the task without synchronisation, hence it might be better through put to store the most likely accessed in a variable called safeThread and check this before entering synchronisation block. If it is the safe thread execute without synchronized wrapper otherwise use the wrapper.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant