Re: MINA3.0 recommended

2017-09-19 Thread Jonathan Valliere
I agree that you need to chose the locking mechanism that suits the needs and not necessarily based on benchmarks. I use ReentrantLock in my code because I use Conditions and tryLock(). Ultimately, it doesn't matter what lock the reactor uses because the SocketChannel uses 3 synchronized mutexes

Re: MINA3.0 recommended

2017-09-19 Thread Emmanuel Lécharny
I would add Brian Goetz take on synchronized vs Lock : https://www.ibm.com/developerworks/library/j-jtp10264/ 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

Re: MINA3.0 recommended

2017-09-19 Thread Emmanuel Lécharny
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

Re: MINA3.0 recommended

2017-09-19 Thread Jonathan Valliere
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. If you look at the tests here: https://dzone.com/articles/synchronized-vs-lock You can see that until you really hit > 2

Re: MINA3.0 recommended

2017-09-18 Thread Emmanuel Lécharny
Le 19/09/2017 à 00:24, Jonathan Valliere a écrit : > Synchronization, unlike Locks, does not create any memory garbage and are > just as fast as CAS under low locking activity. Just because CAS/ Locks > are faster when 8 threads are accessing one object, doesn't mean that > standard Mutex

Re: MINA3.0 recommended

2017-09-18 Thread Jonathan Valliere
Synchronization, unlike Locks, does not create any memory garbage and are just as fast as CAS under low locking activity. Just because CAS/ Locks are faster when 8 threads are accessing one object, doesn't mean that standard Mutex Synchronization doesn't work just find when almost all of the time

Re: MINA3.0 recommended

2017-09-18 Thread Emmanuel Lécharny
Le 18/08/2017 à 07:53, 胡阳 a écrit : > Hi guys: > I read the source code of MINA3.0M2. The style of the code is very good, the > structure is clear, the design is concise and efficient, especially the use > of Selector is unexpected. However, the enqueueWriteRequest method and the >

Re: MINA3.0 recommended

2017-08-18 Thread Emmanuel Lécharny
Le 18/08/2017 à 07:53, 胡阳 a écrit : > Hi guys: Hi ! (Sorry, I can't use your first name, my keyboard is a bit limited ;-) > I read the source code of MINA3.0M2. The style of the code is very good, the > structure is clear, the design is concise and efficient, especially the use > of Selector