Hi,

Does use of wmb() and rmb() for amd64 as defined in sys/amd64/include/atomic.h required use of critical_enter()/critical_exit().

I was looking at the code in sys/amd64/amd64/cpu_switch.S which switches between threads and I don't see any "sfence" instructions in there.

Given the following piece of dummy code:

var_a = 1;
var_b = 2;
wmb();

If there is a task switch between writing var_a and var_b so that the thread in question continues executing on another core, can it happen that the write to var_a is not flushed when wmb() is executed?

var_a = 1;
<task switch to different CPU core>
var_b = 2;
wmb();

--HPS
_______________________________________________
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to