Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Mar 2003 10:13:36 -0800 (PST)
From:      Nate Lawson <nate@root.org>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        cvs-src@FreeBSD.org, src-committers@FreeBSD.org
Subject:   Re: cvs commit: src/sys/sys devicestat.h 
Message-ID:  <Pine.BSF.4.21.0303101009420.93727-100000@root.org>
In-Reply-To: <2856.1047319447@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 10 Mar 2003, Poul-Henning Kamp wrote:
> In message <Pine.BSF.4.21.0303100924470.93706-100000@root.org>, Nate Lawson wri
> tes:
> >I'm unsure why two counters are required.  One counter at the start of the
> >structure is sufficient if you 1. memcpy the structure and then 2. re-read
> >the counter int to make sure it is the same as the one covered by the
> >memcpy.  (This assumes memcpy can read an int atomically which should be 
> >true).  Hmm, a volatile keyword may be necessary for the user-visible
> >struct.
> 
> Think two cpu system.
> 
> One cpu doing the memcpy in userland while the other is updating the
> data structure in the kernel.

This changes nothing about my suggestion as long as you always update the
sequence before changing the structure in the kernel.

-Nate


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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0303101009420.93727-100000>