Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jan 2001 12:37:59 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Mark Murray <mark@grondar.za>
Cc:        cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, jake@FreeBSD.org, Matt Dillon <dillon@earth.backplane.com>
Subject:   Re: Atomic ops (Was Re: cvs commit: src/sys/i386/include atomic.
Message-ID:  <XFMail.010116123759.jhb@FreeBSD.org>
In-Reply-To: <200101161826.f0GIPwI33543@gratis.grondar.za>

next in thread | previous in thread | raw e-mail | index | archive | help

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 <jhb@FreeBSD.org> -- 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




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