Re: Any plans for glib to contain atomic compare/exchange?



On Wed, 2003-07-30 at 10:36, Mike Hearn wrote:
Hi,

In Win32 there are a group of functions that allow you to perform swaps,
compares, compares and swaps and inc/dec in an atomic fashion. They are
called for instance InterlockedExchange, InterlockedCompareExchance,
InterlockedIncrement etc. 

[...]

It's this kind of simple throwaway function that GLib is great for. Are
there any plans to implement this sort of thing? Should I file it in
bugzilla, or is it too low-level? Should I post this to gtk-devel rather
than here? Possible API:

(inline) void g_interlocked_increment(guint *i);
(inline) void g_interlocked_exchange(guint *src, guint *dest);

Well, s/interlocked/atomic/ at your leisure of course. Thoughts?

http://bugzilla.gnome.org/show_bug.cgi?id=63621

Regards,
                                        Owen





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