[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Contention on MINA? WAS: Combined codec and packet

clebert.suconic@jboss.com do-not-reply at jboss.com
Fri May 9 10:05:50 EDT 2008


Yesterday... Just because I wanted to have a little better understanding of the packages.. I navigated through the code with a debugger :-) And I had seen one interesting thing.

org.apache.mina.common.DefaultIoSessionDataStructureFactory has few synchronized collections:


  |     private static class DefaultIoSessionAttributeMap implements IoSessionAttributeMap {
  | 
  |         private final Map<Object, Object> attributes =
  |             Collections.synchronizedMap(new HashMap<Object, Object>(4));
  | 


And on a test I executed today, this appeared in few threads:

pool-3-thread-2" prio=1 tid=0x00007f611431de00 nid=0x32aa waiting for monitor entry [0x000000004444b000..0x000000004444be20]
  | 	at java.util.Collections$SynchronizedMap.get(Collections.java:1979)
  | 	- waiting to lock <0x00007f61296c47c8> (a java.util.Collections$SynchronizedMap)
  | 	at org.apache.mina.common.DefaultIoSessionDataStructureFactory$DefaultIoSessionAttributeMap.getAttribute(DefaultIoSessionDataStructureFactory.java:63)
  | 	at org.apache.mina.common.AbstractIoSession.getAttribute(AbstractIoSession.java:343)
  | 	at org.apache.mina.common.AbstractIoSession.getAttribute(AbstractIoSession.java:339)
  | 	at org.apache.mina.common.SimpleIoProcessorPool.getProcessor(SimpleIoProcessorPool.java:236)
  | 	at org.apache.mina.common.SimpleIoProcessorPool.flush(SimpleIoProcessorPool.java:181)
  | 	at org.apache.mina.common.SimpleIoProcessorPool.flush(SimpleIoProcessorPool.java:1)
  | 	at org.apache.mina.common.DefaultIoFilterChain$HeadFilter.filterWrite(DefaultIoFilterChain.java:644)
  | 	at org.apache.mina.common.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:467)
  | 	at org.apache.mina.common.DefaultIoFilterChain.access$7(DefaultIoFilterChain.java:464)
  | 	at org.apache.mina.common.DefaultIoFilterChain$EntryImpl$1.filterWrite(DefaultIoFilterChain.java:835)
  | 

Shouldn't this be using concurrent?

Are we (including Trustin) aware of that specific possible contention?


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4149774#4149774

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4149774



More information about the jboss-dev-forums mailing list