Back to Lecture Thumbnails
juliewang
legoat
In general, it seems like atomic operations should be faster since they make use of low-level processor instructions. I think that when thread contention is low, these atomic operations do outperform manually locking/giving up locks.
legoat
As for transactional memory in particular, I don't think it is the dominant model yet, although some studies do indicate that it might improve productivity: https://dl.acm.org/doi/10.1145/1989493.1989500
rahulahoop
@juliewang Slide 36 gives an example in which locks work but atomic does not.
Please log in to leave a comment.
Copyright 2021 Stanford University
Transactional memory seems way easier to use and better than locks. Is this the programming model that is dominant in parallel code? i.e. When writing C++ code, should you always be using atomic blocks instead of manually locking and unlocking?