Chapter 18 - Bugs on TinyTM.ofree.FreeObject

35 views
Skip to first unread message

F. Miguel Carvalho

unread,
Nov 10, 2010, 12:31:10 PM11/10/10
to art-of-multiproc...@googlegroups.com

I have detected three types of bugs in the implementation of TinyTM.ofree.FreeObject provided with the source code of the book. Some of these bugs cause exceptions in the use of STM, others are just visible as an inconsistent result, demonstrating that synchronization was not correct (I include the corresponding patch as an attached to this email)

 

1)

Some bugs are related to the implementation of openRead method that has been optimized to NOT make a copy of the ‘oldVersion’ to ‘newVersion’ on Locator object (this operation has some overhead because it uses reflection, instantiates a new object and makes copies of all fields).

If newVersion is null then exceptions may occur when using it. So, whenever openRead returns the value of newVersion, it should either return oldVersion or make a copy of oldVersion to newVersion.

 

2)

In openRead and openWrite methods the new Locator is not created with the correct owner. I added to Locator class a new constructor with a Transaction parameter and the openRead and openWrite methods should instantiate Locator passing the ‘me’ Transaction as argument.

 

3)

The openSequential method should use the ContentionManager to resolve the conflict with another active transaction and avoid the exception.

 

 

FreeObject_FMC.patch
Reply all
Reply to author
Forward
0 new messages