[jboss-jira] [JBoss JIRA] Commented: (JGRP-1122) Revisit critical path in UNICAST
Bela Ban (JIRA)
jira-events at lists.jboss.org
Fri Jan 8 02:50:38 EST 2010
[ https://jira.jboss.org/jira/browse/JGRP-1122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12502884#action_12502884 ]
Bela Ban commented on JGRP-1122:
--------------------------------
The down code:
entry.lock(); // threads will only sync if they access the same entry
try {
seqno=entry.sent_msgs_seqno;
send_conn_id=entry.send_conn_id;
hdr=new UnicastHeader(UnicastHeader.DATA, seqno, send_conn_id, seqno == DEFAULT_FIRST_SEQNO);
msg.putHeader(getName(), hdr);
// AckSenderWindow.add() is costly as it calls Retransmitter.add() which calls TimeScheduler.schedule(),
// which adds the scheduled task to a DelayQueue, which does costly tree rebalancing.
// In 2.9 (or 3.0), we'll replace use of ScheduledThreadPoolExecutor in TimeScheduler with
// a ConcurrentSkipListMap, which is faster (log(n) access cost for most ops). CSLM requires JDK 1.6
// Note that moving the next statement out of the lock scope made for some really ugly code, that's
// why this was reverted !
entry.sent_msgs.add(seqno, msg); // add *including* UnicastHeader, adds to retransmitter
entry.sent_msgs_seqno++;
}
finally {
entry.unlock();
}
could be changed to *not* acquire any lock at all (the lock showed up as a hotsport for thread contention).
However this would mean that a seqno could be lost, for example if we have a temp OOME !
SOLUTION:
Keep track of 'lost' seqnos, e.g. +1 +2 -3 +4 +5, where 3 is lost. We cannot send 3 later because this would make it get delivered *before* messages which were sent after 3 !
Piggyback the NIL information for 3 in other UNICAST messages and skip 3 on the receiver.
> Revisit critical path in UNICAST
> --------------------------------
>
> Key: JGRP-1122
> URL: https://jira.jboss.org/jira/browse/JGRP-1122
> Project: JGroups
> Issue Type: Task
> Reporter: Bela Ban
> Assignee: Bela Ban
> Fix For: 2.9
>
>
> Same as https://jira.jboss.org/jira/browse/JGRP-1104, but for UNICAST. Reduce contention on the down and up directions
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list