atomicity of unlocked reads

Frank Mayhar frank at exit.com
Wed Sep 17 10:51:02 PDT 2003


John Baldwin wrote:
> I think you can assume that the read will be atomic.  I don't think FreeBSD
> would work very well on a machine where aligned pointer reads/writes weren't
> atomic.

I dunno, I tend to think that making such assumptions may well come back to
bite me in the ass when I least expect it.  In such situation, I invariably
use some kind of "atomic_xxx_load/store" primitive that does the job safely
and in a machine-dependent way while hiding the details from the MI code.

Just call me paranoid.
-- 
Frank Mayhar frank at exit.com	http://www.exit.com/
Exit Consulting                 http://www.gpsclock.com/
                                http://www.exit.com/blog/frank/


More information about the freebsd-smp mailing list