Previous | Next --- Slide 37 of 60
Back to Lecture Thumbnails
timothyyeo

This slide wants to say that due to programming errors, atomic region can still suffer from atomicity violation. In this example, the atomic region was erroneously separately in two blocks for thread 1, which makes it possible for thread 2 to make ptr = NULL in between atomic blocks of thread 1. The simple fix is to combine two atomic regions into one for thread 1, but this might result in performance issues.

Please log in to leave a comment.