Hi,
http://www.elsevierdirect.com/companions/9780123705914/exercises/14~Chapter_18.zipAbove link contains the source code of chapter-18, which has implementation of obstruction-free linked list and skip-list ( also locking linked-list and skip-list ).
But when I run ofree linked-list/skip-list cases, It gives run-time error :
Exceptions are:
TinyTM.exceptions.PanicException: java.lang.NullPointerException
at TinyTM.TThread.doIt(TThread.java:51)
at TinyTM.list.ofree.ListTest$TestThread.run(ListTest.java:117)
Caused by: java.lang.NullPointerException
at TinyTM.list.ofree.TNode.getNext(TNode.java:54)
at TinyTM.list.ofree.List.add(List.java:40)
at TinyTM.list.ofree.ListTest$TestThread$1.call(ListTest.java:119)
at TinyTM.list.ofree.ListTest$TestThread$1.call(ListTest.java:117)
at TinyTM.TThread.doIt(TThread.java:41)
... 1 more
Upon investigating the issue, turns out that from FreeObject.java, openRead function is returning null. which is
if (start.compareAndSet(oldLocator, newLocator)) {
return newLocator.newVersion; // this value is null.
}
If someone has right direction, what to do, kindly let me know. also update on the companion website.
--
o
| _ o |_ o __ _|
_| (_| | | | | | |(_|
Peeyush Agrawal.