Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 07 Dec 2000 14:09:43 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Dan Eischen <eischen@vigrid.com>
Cc:        smp@FreeBSD.org
Subject:   RE: Userland atomic assignments
Message-ID:  <XFMail.001207140943.jhb@FreeBSD.org>
In-Reply-To: <3A2FFDD9.F17C1165@vigrid.com>

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

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 <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 freebsd-smp" in the body of the message




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