Previous | Next --- Slide 3 of 64
Back to Lecture Thumbnails
byeongcp

Kayvon mentioned what a transaction is multiple times in this lecture that went something along the line of this: "Everything in this block either happens or doesn’t happen. System is now responsible for making sure those semantics are ensured. There are no partial transactions. All the writes are visible to other threads or none are visible” which I thought was particularly helpful in understanding transaction as an abstraction. It is also summarized in this slide.

Also, I thought this slide that talked about the difference between atomic vs lock/unlock was helpful in understanding the difference between a transaction (atomic code block that is a higher abstraction) and lock/unlock primitives which are primitives that could be used to implement transaction.

sanchuah

I am a little bit confused about the semantic difference between transaction and atomicity. Are there are same thing? I know that transaction means that all the operation should execute all-or-none, but I am confused the definition of atomicity.

HLAHat

Well, I believe the way we've been using the term "atomic" in this class simply refers to critical regions of code. So, if a region of a program is atomic, it will appear that only one thread will be in that section performing work (introducing sequential work to the program). Transactional memory is one way to provide this functionality. That is, a transactional set of memory operations will be atomic, but atomicity need not be implemented by transactions(one could use the lock-based methods covered earlier instead).

Also, note that in transactional memory operations, multiple threads are in the atomic section of code, but only one thread will actually succeed maintaining the appearance of an atomic set of operations.

vrazdan

Also the other definition of atomic can be seen as it is executed as a single instruction on a processor (such as how there is hardware support for compare and swap, rather than using multiple instructions to load, compare the value, and branch if needed).