From owner-freebsd-current Mon Mar 27 0:48:24 2000 Delivered-To: freebsd-current@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id 61E3437BAFA; Mon, 27 Mar 2000 00:48:14 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.3/8.9.1) id AAA37083; Mon, 27 Mar 2000 00:48:12 -0800 (PST) (envelope-from dillon) Date: Mon, 27 Mar 2000 00:48:12 -0800 (PST) From: Matthew Dillon Message-Id: <200003270848.AAA37083@apollo.backplane.com> To: Mike Smith Cc: Warner Losh , Mike Smith , Daniel Eischen , nms@otdel-1.org, freebsd-current@FreeBSD.ORG Subject: Re: Is there spinlocks/semaphores available for drivers? References: <200003270720.XAA05430@mass.cdrom.com> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG : :> In message <200003270639.WAA05313@mass.cdrom.com> Mike Smith writes: :> : What about it in particular? Or are you referring to overflow handling? :> :> Yes. Well, I guess I assumed it was a circular thing, and you'd need :> to have some comparison against read index, which would be racible. : :Not if you think about it; all you need are atomic read/write operations :for the indexes. Circular FIFOs are kinda neat like that. 8) : :-- :\\ Give a man a fish, and you feed him for a day. \\ Mike Smith Well, monotonically increasing (except when it wraps), and atomic writes. Atomic read-modify-writes are not required which means that no locking is needed at all, not even a 'lock' prefix (though on some architectures you have to worry about delayed commits between cpu's). -Matt Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message