Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Sep 2009 09:40:20 -0500
From:      Robert Noland <rnoland@FreeBSD.org>
To:        Ryan Stone <rysto32@gmail.com>
Cc:        attilio@freebsd.org, hackers@freebsd.org, Fabio Checconi <fabio@freebsd.org>
Subject:   Re: sx locks and memory barriers
Message-ID:  <1253889620.2065.12.camel@balrog.2hip.net>
In-Reply-To: <bc2d970909250630x3143cbb6k6be2b84e33455ac6@mail.gmail.com>
References:  <20090924224935.GW473@gandalf.sssup.it> <1253877997.2031.2627.camel@balrog.2hip.net> <bc2d970909250630x3143cbb6k6be2b84e33455ac6@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 2009-09-25 at 09:30 -0400, Ryan Stone wrote:
> The code that Fabio proposes looks like this:
> 
> sx_slock(&data->lock);
> if (data->buffer)
>     a = *data->buffer;
> sx_sunlock(&data->lock);
> 
> 
> This point is that without a memory barrier on the unlock, the CPU is
> free to reorder the instructions into the order is his message.

Ok, then I will sit back and wait for someone with more clue to
respond...

robert.

-- 
Robert Noland <rnoland@FreeBSD.org>
FreeBSD




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1253889620.2065.12.camel>