BUG-650: optimize DOMForwardedWriteTransaction 00/11100/1
authorRobert Varga <rovarga@cisco.com>
Fri, 12 Sep 2014 10:05:14 +0000 (12:05 +0200)
committerRobert Varga <rovarga@cisco.com>
Fri, 12 Sep 2014 12:56:05 +0000 (14:56 +0200)
commit23a3dea5804c8198e61f550736911b5c992d6b6d
treea012c89db45c5219789119078fd21a03fc0ea435
parentd9a98715f3559e510fb5e8142d3d7cb0ab98fa3b
BUG-650: optimize DOMForwardedWriteTransaction

First make sure we get visiblity into cohorts as a collections. This
allows us to optimize allocation of the list where we hold the futures.
We also make it non-immutable -- it is handed off, so there is no reason
to pay the price of an additional allocation.

Second we optimize the transaction state checking by eliminating as
many volatile read/writes as possible. The bottom line is the following:

1) the put/merge/delete paths see only a single volatile read instead of
   two
2) the submit path performs only one volatile get+set and an ordered
   write -- instead of two reads and two writes
3) the cancel path performs a volatile get+set and either an ordered
   write (fast path) or a spin on volatile read (slow path) -- instead of
   a synchronized block, four volatile reads and two volatile writes

Change-Id: I5ec875e65acdee62a4f0daf233617e6af024637f
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/AbstractDOMForwardedCompositeTransaction.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMForwardedWriteTransaction.java