login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
netbsd-tech-kern
»
2007
»
March
»
13
Re: Atomic ops API
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Jonathan Stone
Subject:
Re: Atomic ops API
Date: Tuesday, March 13, 2007 - 10:02 am
In message <E1HR9yM-0001ys-00@smeg.dsg.stanford.edu>,
jonathan@dsg.stanford.edu
writes:
quoted text
> >In message <20070313161735.GA5993@polynum.com>, >tlaronde@polynum.com writes: > >>On Tue, Mar 13, 2007 at 08:26:51AM -0700, Jason Thorpe wrote: >[...] >>> >>> Hm, if it is compare-and-swap, then great... but I thought it was >>> compare-and-set. Anyway, if you could double-check for me, that would >>> be great -- m68k is one of the platforms I was thinking of when I went >>> with "compare-and-store" >> >>cas is "compare and swap" from Solaris Internals, second edition, page >>820. > >CAS meaning "compare and swap" goes back to the IBM 370. Usage on >sparcv9 and 68040+ is, IIRC, compatible. > >The three arguments are: address, expected value, new value. The >value at the address is atomically overwritten by the new value if and >only if the value at the address (atomically) matches the expected value. > >CAS with boolean result (swapped, or not) lets algorithm designers >refetch the current value and restart their atomic operation. You >don't strictly need to atomically return the old value when it differs >from the expected value. > >Typically, effort goes into avoiding the so-called "A/B/A" problem, >where one thread reads value A at address L, a second thread reads A >from L, modifies L to B, and then back to A; whereupon the first >thread reads "A" (with a CAS) and presume that the location value >hasn' changed since its prior read. (Consider "A" being a pointer >which has been freed, then reallocated as an object of a different type). > >But for data structures with simple semantics like counters, >that doesn't matter. >
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
Atomic ops API
, Jason Thorpe
, (Mon Mar 12, 11:28 pm)
Re: Atomic ops API
, SODA Noriyuki
, (Mon Mar 12, 11:55 pm)
Re: Atomic ops API
, Joerg Sonnenberger
, (Tue Mar 13, 5:41 am)
Re: Atomic ops API
, Jason Thorpe
, (Tue Mar 13, 8:14 am)
Re: Atomic ops API
, Jason Thorpe
, (Tue Mar 13, 8:16 am)
Re: Atomic ops API
, Ignatios Souvatzis
, (Tue Mar 13, 8:18 am)
Re: Atomic ops API
, Jason Thorpe
, (Tue Mar 13, 8:26 am)
Re: Atomic ops API
, Martin Husemann
, (Tue Mar 13, 8:27 am)
Re: Atomic ops API
, Jason Thorpe
, (Tue Mar 13, 8:36 am)
Re: Atomic ops API
, Ignatios Souvatzis
, (Tue Mar 13, 8:43 am)
Re: Atomic ops API
, Andrew Doran
, (Tue Mar 13, 8:49 am)
Re: Atomic ops API
, Brian Ginsbach
, (Tue Mar 13, 8:53 am)
Re: Atomic ops API
, tlaronde
, (Tue Mar 13, 9:17 am)
Re: Atomic ops API
, Jason Thorpe
, (Tue Mar 13, 9:31 am)
Re: Atomic ops API
, Joerg Sonnenberger
, (Tue Mar 13, 9:31 am)
Re: Atomic ops API
, Jason Thorpe
, (Tue Mar 13, 9:33 am)
Re: Atomic ops API
, Jason Thorpe
, (Tue Mar 13, 9:34 am)
Re: Atomic ops API
, jonathan
, (Tue Mar 13, 9:35 am)
Re: Atomic ops API
, Ben Harris
, (Tue Mar 13, 9:36 am)
Re: Atomic ops API
, jonathan
, (Tue Mar 13, 9:49 am)
Re: Atomic ops API
, Jason Thorpe
, (Tue Mar 13, 9:58 am)
Re: Atomic ops API
, Jonathan Stone
, (Tue Mar 13, 10:02 am)
Re: Atomic ops API
, Jason Thorpe
, (Tue Mar 13, 10:05 am)
re: Atomic ops API
, matthew green
, (Tue Mar 13, 12:56 pm)
Re: Atomic ops API
, Bang Jun-Young
, (Tue Mar 13, 5:42 pm)
Re: Atomic ops API
, Bang Jun-Young
, (Tue Mar 13, 5:52 pm)
Re: Atomic ops API
, Jason Thorpe
, (Tue Mar 13, 8:10 pm)
Re: Atomic ops API
, Johnny Billquist
, (Wed Mar 14, 5:18 am)
Re: Atomic ops API
, SODA Noriyuki
, (Wed Mar 14, 6:13 am)
Re: Atomic ops API
, SODA Noriyuki
, (Wed Mar 14, 6:17 am)
Re: Atomic ops API
, Jason Thorpe
, (Wed Mar 14, 9:11 am)
Re: Atomic ops API
, Bang Jun-Young
, (Wed Mar 14, 10:44 am)
Re: Atomic ops API
, Johnny Billquist
, (Wed Mar 14, 11:39 am)
68k CAS (was: Atomic ops API)
, Edgar
, (Wed Mar 14, 1:32 pm)
Re: 68k CAS (was: Atomic ops API)
, David Laight
, (Wed Mar 14, 2:59 pm)
Re: Atomic ops API
, Bang Jun-Young
, (Wed Mar 14, 5:17 pm)
Re: Atomic ops API
, Johnny Billquist
, (Thu Mar 15, 1:51 am)
Re: Atomic ops API
, Bang Jun-Young
, (Thu Mar 15, 5:38 am)
Re: Atomic ops API
, Johnny Billquist
, (Thu Mar 15, 5:54 am)
Re: Atomic ops API
, Bang Jun-Young
, (Thu Mar 15, 7:06 am)
Re: Atomic ops API
, Johnny Billquist
, (Thu Mar 15, 7:40 am)
Re: Atomic ops API
, Bang Jun-Young
, (Thu Mar 15, 8:43 am)
Re: Atomic ops API
, Johnny Billquist
, (Thu Mar 15, 9:23 am)
Re: Atomic ops API
, Jason Thorpe
, (Thu Mar 15, 9:24 am)
re: Atomic ops API
, matthew green
, (Thu Mar 15, 11:26 am)
Re: Atomic ops API
, Jason Thorpe
, (Thu Mar 15, 11:54 am)
Re: Atomic ops API
, Johnny Billquist
, (Fri Mar 16, 2:21 am)
Re: Atomic ops API
, Johnny Billquist
, (Fri Mar 16, 2:25 am)
Re: Atomic ops API
, Jason Thorpe
, (Fri Mar 16, 8:50 am)
Re: Atomic ops API
, Ignatios Souvatzis
, (Fri Mar 16, 8:51 am)
Re: Atomic ops API
, Jason Thorpe
, (Fri Mar 16, 8:51 am)
Re: Atomic ops API
, David Laight
, (Fri Mar 16, 9:01 am)
Re: Atomic ops API
, Johnny Billquist
, (Mon Mar 19, 3:09 am)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Michael Trimarchi
Re: [PATCH] VFS: make file->f_pos access atomic on 32bit arch
Miklos Szeredi
[patch 14/15] vfs: more path_permission() conversions
Serge E. Hallyn
Re: [RFC v5][PATCH 7/8] Infrastructure for shared objects
Bernd Schmidt
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Takashi Iwai
[PATCH 2/2] input: Add LED support to Synaptics device
git
:
Junio C Hamano
Re: mingw, windows, crlf/lf, and git
Eyvind Bernhardsen
Re: Where has "git ls-remote" reference pattern matching gone?
Shawn O. Pearce
Re: Switching from CVS to GIT
Todd Zullinger
Re: [PATCH 2/2] send-email: rfc2047-quote subject lines with non-ascii characters
Santi Béjar
Re: How to use git-fmt-merge-msg?
linux-netdev
:
Ramkrishna Vepa
[net-2.6 PATCH 1/10] Neterion: New driver: Driver help file
Mark Anthony
invitation / inquiry
Ingo Molnar
Re: [PATCH 08/16] dma-debug: add core checking functions
David Miller
Re: [PATCH 1/3] f_phonet: dev_kfree_skb instead of dev_kfree_skb_any in TX callback
Sascha Hauer
[PATCH 03/12] fec: do not typedef struct types
git-commits-head
:
Linux Kernel Mailing List
amba: struct device - replace bus_id with dev_name(), dev_set_name()
Linux Kernel Mailing List
MIPS: Yosemite: Convert SMP startup lock to arch spinlock.
Linux Kernel Mailing List
ARM: S5PC100: IRQ and timer
Linux Kernel Mailing List
davinci: edma: clear interrupt status for interrupt enabled channels only
Linux Kernel Mailing List
x86, mm, kprobes: fault.c, simplify notify_page_fault()
openbsd-misc
:
Daniel A. Ramaley
Re: [semi-OT] Can anyone recommend an OpenBSD-compatible colour laser printer?
Matthias Kilian
Re: can't get vesa @ 1280x800 or nv
Tobias Ulmer
Re: Problem after upgrade 4.5 to 4.6: ERR M
Philip Guenther
Re: SIGCHLD and libpthread.so
J.C. Roberts
Re: [semi-OT] Can anyone recommend an OpenBSD-compatible colour laser printer?
Colocation donated by:
Syndicate