Le 19/09/2017 à 15:28, Jonathan Valliere a écrit :
> I forget, does MINA uses the same Processor for both read and write
> operations?  If so, there will never be contention unless you use a Thread
> Executor Pool in the Filters.

It does. MINA use always the same IoProcessor for one session, to avoid
having to manage the session attributes access across may threads. As
you said, one can add a Executor filter, but then, it's up to the
application to deal with concuttent accesses.

>
> If you look at the tests here:
> https://dzone.com/articles/synchronized-vs-lock  You can see that until you
> really hit > 2 threads, sync actually is faster.

I find this article a bit dubious. The numbe this guy get for 2 threads
is clearly problematic. You will find other blogs that shows Locks are
better as soon as you have more than a thread :

http://lycog.com/concurency/performance-reentrantlock-synchronized/
or
https://objectpartners.com/2011/11/29/java-synchronization-method-performance-comparison/

I won't say I fully trust those blog posts : there are too many moving
pieces (Java version, benchmark, OS used, etc)

But overall, I would say it's not a clear cut.


-- 
Emmanuel Lecharny

Symas.com
directory.apache.org

Reply via email to