From owner-freebsd-smp Thu Mar 22 10: 4:16 2001 Delivered-To: freebsd-smp@freebsd.org Received: from gratis.grondar.za (grouter.grondar.za [196.7.18.65]) by hub.freebsd.org (Postfix) with ESMTP id BE7FB37B71F for ; Thu, 22 Mar 2001 10:04:11 -0800 (PST) (envelope-from mark@grondar.za) Received: from grondar.za (root@gratis.grondar.za [196.7.18.133]) by gratis.grondar.za (8.11.1/8.11.1) with ESMTP id f2MI3tf50897; Thu, 22 Mar 2001 20:03:55 +0200 (SAST) (envelope-from mark@grondar.za) Message-Id: <200103221803.f2MI3tf50897@gratis.grondar.za> To: Tony Finch Cc: freebsd-smp@FreeBSD.ORG Subject: Re: Locked data-structures and delayed writes. References: In-Reply-To: ; from Tony Finch "Thu, 22 Mar 2001 15:23:02 GMT." Date: Thu, 22 Mar 2001 20:05:04 +0200 From: Mark Murray Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > 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