From owner-freebsd-smp Thu Dec 7 14:26: 4 2000 From owner-freebsd-smp@FreeBSD.ORG Thu Dec 7 14:26:02 2000 Return-Path: Delivered-To: freebsd-smp@freebsd.org Received: from pike.osd.bsdi.com (pike.osd.bsdi.com [204.216.28.222]) by hub.freebsd.org (Postfix) with ESMTP id 8D09337B400 for ; Thu, 7 Dec 2000 14:26:02 -0800 (PST) Received: from laptop.baldwin.cx (root@jhb-laptop.osd.bsdi.com [204.216.28.241]) by pike.osd.bsdi.com (8.11.1/8.9.3) with ESMTP id eB7MPQ730849; Thu, 7 Dec 2000 14:25:26 -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: Date: Thu, 07 Dec 2000 14:26:15 -0800 (PST) From: John Baldwin To: Daniel Eischen Subject: Re: Userland atomic assignments Cc: smp@FreeBSD.org, Jason Evans Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On 07-Dec-00 Daniel Eischen wrote: > On 7 Dec 2000, Jason Evans wrote: >> On Thu, Dec 07, 2000 at 04:15:05PM -0500, Dan Eischen wrote: >> > What kind of atomic operations can we get in userland? >> > If I have a singly linked list, where nodes are only added >> > to the head or the tail and they are never removed, can I >> > walk the list without fear of catching a bad head or >> > node->next (when I'm at the end of the list) pointer? >> > >> > In other words, can I get an atomic_set_ptr() operation >> > on each platform? I can also see the need for an >> > atomic_set_int32() operation. >> >> I don't think we have an official API for atomic operations in userland. >> There is , but it isn't documented as a userland API. I >> agree that we need this or something similar in userland though. Any ideas >> on the cleanest way to provide this? > > Something along the lines of I'd guess. > I don't need compare and set, nor anything that complicated, > just a couple of atomic store operations. I'm finding some > places in libc that could really use an atomic_store_ptr(). a = b; should be atomic I think. If its not, then large portions of the kernel break, IIRC. > -- > Dan Eischen -- 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 freebsd-smp" in the body of the message