Re: GAtomic int finals (#63621)



Hi Owen,

> I don't have a big opinion here, but my basic reasoning would be:
> 
>  - The operation is a bit "odd" - you aren't going to know how to use it
>    unless you've seen it before.
>  - So sticking to the name found elsewhere is better than trying to 
>    come up with a name that makes the operation obvious.

Ok, but then we shouldn't use both swap and exchange as in
g_atomic_int_exchange_and_add and g_atomic_int_compare_and_swap.
We should stick to one and if we want to use established terminology,
that would be compare_and_exchange, as swap_and_add doesn't exists
according to google. But what an endless function name:

g_atomic_pointer_compare_and_exchange

We could use ptr instead of pointer (like in GPtrArray) and xchg/cmp
instead of exchange/compare however:

g_atomic_int_xchg_and_add
g_atomic_ptr_cmp_and_xchg

seems a bit easier to handle. 

> I like having the atom_inc / atom_dec_and_test since I think these are
> the operations that people will do frequently. Yes, there might be cases
> where people want something else, but these will be the frequent ones.
> 
> And having their definitions in the header file will actually help
> people figure out what they need to do when they want to do something
> different.

ACK. So I leave them in for now.

> Someone does need to contact the libc maintainers and maybe the FSF
> before we ship a final release with the big macros in it. I guess I
> should take responsibility for bouncing this off of Ulrich Drepper.

Thanks for doing that. I really don't feel comfortable with licensing
stuff.... Too many pitfalls (more than in multithreading?)

Bye,
Sebastian
-- 
Sebastian Wilhelmi                 |            här ovanför alla molnen
mailto:seppi seppi de              |     är himmlen så förunderligt blå
http://seppi.de                    |




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]