Previous | Next --- Slide 49 of 75
Back to Lecture Thumbnails
ammaar

What is the difference between a memory thread and a barrier?

timothy

Assuming you mean memory fence vs barrier, these are serving different purposes! A memory fence is saying "you can reorder all the read/writes on the same side of a fence, but you cannot perform a read/write that falls after a fence before a read/write that falls before that fence." A barrier is saying "all threads must reach this point before continuing." Fences serves as a tool to help with memory consistency and instruction reordering, barriers are a tool for thread synchronization, like a lock.

Please log in to leave a comment.