Re: svn commit: r230201 - head/lib/libc/gen

[ Available lists | Index of svn-src-head | Month of Jan 2012 | Week of 18 Jan 2012 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
David Xu <listlog2011@gmail.com>
Date
18 Jan 2012 02:09:29
Subject
Re: svn commit: r230201 - head/lib/libc/gen
Message-ID
4F1629D5.4020605@gmail.com


[ Hide this part ]
On 2012/1/17 22:57, John Baldwin wrote:
> On Monday, January 16, 2012 1:15:14 am 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.
> I think using atomic_load_acq() on sem->nwaiters would be clearer as it would
> indicate which variable you need to ensure is read after other operations. In
> general I think raw rmb/wmb usage should be avoided when possible as it is
> does not describe the programmer's intent as well.
>
Yes, I had considered that I may use atomic_load_acq(), but at that time,
I thought it emits a bus locking, right ? so I just picked up rmb() which
only affects current cpu. maybe atomic_load_acq() does same thing with
rmb() ?
it is still unclear to me.

Regards,
David Xu

Elapsed time: 0.213 seconds