From owner-freebsd-smp Thu Dec 7 14: 9:30 2000 From owner-freebsd-smp@FreeBSD.ORG Thu Dec 7 14:09:29 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 2B29137B400 for ; Thu, 7 Dec 2000 14:09:29 -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 eB7M8s730300; Thu, 7 Dec 2000 14:08:54 -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: <3A2FFDD9.F17C1165@vigrid.com> Date: Thu, 07 Dec 2000 14:09:43 -0800 (PST) From: John Baldwin To: Dan Eischen Subject: RE: Userland atomic assignments Cc: smp@FreeBSD.org Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On 07-Dec-00 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. atomic_cmpset() can't be used because it dinks with interrupts in the i386 case. Also, you would need to #define SMP so that the lock prefixes would be compiled in for the x86 case. You are probably better off just using userland mutexes. Also, not that atomic_set() does an or operation, whereas atomic_store() does an actual assignment. > Thanks, > > -- > 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