On 2012/1/16 15:39, Lawrence Stewart wrote:
On 01/16/12 17:15, David Xu wrote:
Author: davidxu
Date: Mon Jan 16 06:15:14 2012
New Revision: 230201
URL: http://svn.freebsd.org/changeset/base/230201

Log:
   Insert read memory barriers.

Modified:
   head/lib/libc/gen/sem.c
   head/lib/libc/gen/sem_new.c

Could you please provide a bit more information about why these are necessary and why they weren't there before (or how you figured out that there was a problem without them)? I learn a lot by reading commit mail, but only when the log message and any added code comments explain the "what" *and* the "why".

Cheers,
Lawrence

I know this is rather obscure and diffcult to understand, the problem is here
we have two variables m, n, and two threads A, B.
the A wants to set m, than looks n, while B is in reverse order,
it should be in strict order, but since atomic.h does not have a full barrier
atomic operation interface, I intend to add a rmb() here.
though X86 may not need this, but other arches may not work in this way.

Regards,
David Xu


_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to