BUG-1886: implement lock-free InMemoryDataTree.commit() 40/11240/1
authorRobert Varga <rovarga@cisco.com>
Tue, 16 Sep 2014 13:31:30 +0000 (15:31 +0200)
committerRobert Varga <rovarga@cisco.com>
Tue, 16 Sep 2014 14:09:47 +0000 (16:09 +0200)
commit8b5a70355134bfeb6b4d3299bff733817d9eb72b
treedbb10ebb596e3a6ca5001d6ec1bc09cdff08b1eb
parentfa617231bb83ab0c45e6a5c8cabeec2b8fe1efeb
BUG-1886: implement lock-free InMemoryDataTree.commit()

This patch reworks the data layout to remove all locking from the hold
codepaths. All state is not encapsulated in DataTreeState which is
atomically replaced.

The allocation, verification and preparation of a modification are
both lock- and wait-free.

Schema context is still synchronized to preventmadness
from concurrent schema context changes.

Commit runs lock-free, but may retry operations if it races with schema
context change -- which should happen rarely if ever.

Change-Id: I296b2805ef2575e76052e004a0d317a098d207df
Signed-off-by: Robert Varga <rovarga@cisco.com>
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/DataTreeState.java [new file with mode: 0644]
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/InMemoryDataTree.java