Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22134

Why do we need both read and write barriers?

$
0
0

Why do we need to define two types of barriers with the same implementation?

For example, this code from io_uring in Linux:

#if defined(__x86_64) || defined(__i386__)#define read_barrier()  __asm__ __volatile__("":::"memory")#define write_barrier() __asm__ __volatile__("":::"memory")#else

Viewing all articles
Browse latest Browse all 22134

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>