Previous | Next --- Slide 7 of 60
Back to Lecture Thumbnails
xiyan

Will the cache of P2 be cleared when T2 commits (looks like the read set / write set is cleared)? i.e. Will Read A in T3 be reading from cache or memory, assuming T1 did not commit yet.

shaan0924

@xiyan I believe so. When a transaction commits, the write set needs to be written to memory, which should cause the cache to write back (and potentially flush). Also, T3's reads have to account for the possibility that other transactions have completed before it, so reading new variables from solely the cache can causes issues.

kristinayige

Note: there is no W/W conflict causing abort of T3 (in P2) because the writing action doesn't load the object to its read set. Therefore, it's not necessary to abort of the conflict.

lordpancake

By the end of this example, there's a race condition whereby C can either be C = 4 or C = 7, but it seems that by the rules or by our choice in programming we are okay with that.

Please log in to leave a comment.