David M. Lloyd wrote:
On 05/14/2008 11:20 AM, Emmanuel Lecharny wrote:

What I can tell at least though is that the session configuration properties provided by IoService should be volatile, because they are accessed in a different thread (I/O processor) almost always.
Use synchronization, not volatile. it's too dangerous. When we are sure that it works fine, we _may_ switch to volatile.

I don't understand this? Volatile isn't dangerous at all. It's clearly defined and well-specified, and using it to make fields have multi-thread visibility is a perfectly fine usage for them.
The problem is not that volatile is dangerous by itself. Its semantic is really clear, assuming that you _know_ what you can and can't do. This is what scared me : mis-used of volatile.

Before of using it, I would rather prefer that we expose the clear benefits we will get from it (and please, bring the numbers with you ;) before using it all over the code.

We are talking about minor improvement in this area. We have much bigger issues and much more important thinsg to deal with in MINA 2.0.

When MINA 2.0 will be out, code tested, performance checked, javadoc written, unit tests added, user documentation updated, issues fixed, then we may have fun playing with bits and nanoseconds. Until then...


Thanks !



- DML



--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org


Reply via email to