Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Mar 2001 20:05:04 +0200
From:      Mark Murray <mark@grondar.za>
To:        Tony Finch <dot@dotat.at>
Cc:        freebsd-smp@FreeBSD.ORG
Subject:   Re: Locked data-structures and delayed writes. 
Message-ID:  <200103221803.f2MI3tf50897@gratis.grondar.za>
In-Reply-To: <E14g6vW-00077j-00@hand.dotat.at> ; from Tony Finch <dot@dotat.at>  "Thu, 22 Mar 2001 15:23:02 GMT."
References:  <E14g6vW-00077j-00@hand.dotat.at> 

next in thread | previous in thread | raw e-mail | index | archive | help
> Anyway, the question at hand is what happens if two threads on
> different CPUs are accessing the same locked data structure when the
> CPU delays writes to RAM, i.e.
> 
> 	acquire_lock(s);
> 	modify(s);
> 	release_lock(s);
> 
> Things are very broken if the write can be delayed until after the
> lock is released. What prevents that?

"man atomic", and look at the "acquire" and "release" memory barriers.

M
-- 
Mark Murray
Warning: this .sig is umop ap!sdn

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message




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