From owner-cvs-all Tue Jan 16 12:38:40 2001 Delivered-To: cvs-all@freebsd.org Received: from meow.osd.bsdi.com (meow.osd.bsdi.com [204.216.28.88]) by hub.freebsd.org (Postfix) with ESMTP id BE3D637B404; Tue, 16 Jan 2001 12:38:13 -0800 (PST) Received: from laptop.baldwin.cx (john@jhb-laptop.osd.bsdi.com [204.216.28.241]) by meow.osd.bsdi.com (8.11.1/8.9.3) with ESMTP id f0GKaCL17812; Tue, 16 Jan 2001 12:36:12 -0800 (PST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200101161826.f0GIPwI33543@gratis.grondar.za> Date: Tue, 16 Jan 2001 12:37:59 -0800 (PST) From: John Baldwin To: Mark Murray Subject: Re: Atomic ops (Was Re: cvs commit: src/sys/i386/include atomic. Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, jake@FreeBSD.org, Matt Dillon Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 16-Jan-01 Mark Murray wrote: >> A bottom half / top half circular FIFO does not need to use atomic ops >> at all. The writer simply manipulates the WIndex and the reader >> simply manipulates the RIndex. If you have multiple readers or >> multiple writers, then you have a locking issue, but if you don't there >> are no issues. > > I have multiple writers, and a single reader. Perhaps making the issue > easier is the fact that I don't mind losing harvested events, so if a > writer can't write, tough luck, do nothing and return. > >> On a non-intel box that does not guarentee write ordering, you would >> need a memory barrier function prior to updating the WIndex to >> ensure that the FIFO data is in place as of the time the reader tests >> its RIndex against the WIndex. > > This is the way I've got it, more-or-less. I'm hoping for a method that > does not involve memory barriers, if I can. I'm playing with ideas right > now. Only having 1 mb is better than having two. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message