lkml.org 
[lkml]   [2016]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] atomic: Fix bugs in 'fetch_or()' and rename it to 'xchg_or()'

* Peter Zijlstra <peterz@infradead.org> wrote:

> On Tue, Mar 15, 2016 at 10:32:45AM +0100, Ingo Molnar wrote:
> > 2) its naming sucks. "fetch_or()" does not really signal that it's a
> > fundamentally atomic operation, nor what API family it belongs to.
>
> I disagree there, the fetch-$op naming is widely used for atomic
> operations that return the previous value. See for example the C/C++11
> atomic ops.

The problem I see is that we don't really have the fetch_*() naming in the kernel
right now, while we do have the xchg_*() naming. The latter is 'obviously' an
atomic operation - while 'fetch' could be anything.

No strong opinion, but I think fetch_or() is not a particularly good name.

Thanks,

Ingo

\
 
 \ /
  Last update: 2016-03-15 13:41    [W:1.755 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site