tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: 2*(void *) atomic swap?



   Date: Thu, 30 Jul 2015 12:11:06 -0700
   From: Dennis Ferguson <dennis.c.ferguson%gmail.com@localhost>

   On 30 Jul, 2015, at 11:23 , Taylor R Campbell <campbell+netbsd-tech-kern%mumble.net@localhost> wrote:

   > - On amd64, use cmpxchg16b.

   Using this would preclude running on some older machines including,
   apparently, some Core 2 motherboards.  Is that okay?

I guess it's not as prevalent as my cursory research earlier today
suggested.  It wouldn't preclude running on such machines -- it would
just require falling back to a more expensive option.

   > - On ll/sc machines, use ll/sc.

   I know arm does double word ll/sc, but what else does?
   I don't know of a way to use single register ll/sc to do an
   atomic swap of two pointers.

I was thinking that the ll/sc would work on cache line granularity,
not on word granularity, so as long as the words don't cross a cache
line it would work.  But I don't work much with ll/sc machines these
days, so I am likely to be wrong.


Home | Main Index | Thread Index | Old Index