TM Research Journal

Monday, March 27, 2006

DSTM: Found the Problem - Don't know the Solution

I figured out why reference counting the locators isn't working. The problem is, I don't know how to solve this problem.

Basically, when a thread opens an object for writing, and if it manages to compare and swap the start pointer, it decrements the number of references to the newly created locator (since the local reference is going to fall out of scope), and it is possible that in that instant when the number of references has been decremented to 1 (since the start pointer is still poiting to it), and before it actually returning the reference to the object that another transaction might jump in, abort this transaction and swap the pointer. This other transaction will see that the number of references to the locator is one, would decrement it since it it switched the start pointer, and clear it since there are no more pointers to it.

Hope the above made sense.

How to solve this problem?

First solution which comes to mind is to add reference counters to the objects. I fear though that this would require even more locks and that there would be even more unforseen problems here.

Another one would be to somehow (haven't thought this through yet) invalidate the old object (setting the pointer to null) - don't think this'll work though.

James mentioned that the paper Jim sent today deals with Garbage Collection and this sort of thing, so I guess that this afternoon I'll read those papers and maybe see if it is possible to come up with a better solution.

Peace Out!

0 Comments:

Post a Comment

<< Home