Dynamic reads without locking.

Tim Kientzle kientzle at acm.org
Fri Oct 10 00:46:03 PDT 2003

Harti Brandt wrote:
> Yes. When I read the C standard
> 	foo = data & mask;
> wouldn't also help, because there is no sequence point in this statement
> except at the ;.

Before anyone takes this particular line of reasoning seriously,
I feel compelled to point out that sequence points have nothing to
do with this.

a) Sequence points are an "as if" requirement.  The
    program must produce the same results "as if" it
    strictly obeyed sequence points.  It doesn't have
    to really operate that way.  (And, in fact, well-optimized
    programs running on modern processors rarely do.)

b) Sequence points say NOTHING about how multiple
    threads or processors interact.

Sorry, but the C standard doesn't help here.  The
C standard does not address multi-threading at all.

Tim Kientzle

More information about the freebsd-hackers mailing list