What is the difference between a memory thread and a barrier?
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.