atomic-swap
atomic operation implementation
i am using atomic operation provided by SunOs in <sys/atomic.h> , which is void *atomic_cas_ptr(volatile void *target, void *cmp, void *newval);[详细]
2023-03-13 20:41 分类:问答Sun compiler's equivalent of gcc's __sync_fetch_and_add? aka Oracle Studio 12.2
Does the Oracle (Sun) Studio 12.2 C/C++/Fortran c开发者_运维知识库ompiler for Linux 64-bit have an equivalent to the __sync_fetch_and_add function that is provided in gcc?I can\'t seem to find the wra[详细]
2023-03-02 18:03 分类:问答GLIB: g_atomic_int_get becomes NO-OP?
In a larger piece of code, I noticed that the g_atomic_* functions in glib were not doing what I expected, so I wrote this simple example:[详细]
2023-02-22 20:34 分类:问答atomically changing multiple rows in mySQL
I have a mySQL table of the form entryID (PK), UserID, entryName Each user (as defined by his userID) may create any number of entries in this table, but for each user, the entryName must be unique.[详细]
2023-02-19 08:03 分类:问答Possible to create AtomicReference that can be swapped atomically?
Is there any way to implement a type of reference whose value can be exchanged with another atomically?[详细]
2023-02-06 22:43 分类:问答Can this Fast Atomic Lock implementation work?
I have a large data structure that is using striping to reduce lock contention.Right 开发者_JAVA百科now I am using system locks but 99.99% of the time, the lock is uncontested and futhermore, the amou[详细]
2023-01-06 18:15 分类:问答Is OSCompareAndSwap (Mac OS X) equivalent to CMPXCHG8B?
Is OSCompareAndSwa开发者_如何学Gop (Mac OS X) equivalent to CMPXCHG8B?You can find the definition of the atomic functions in the OSAtomic.s file in the XNU source.For example, here\'s OSAtomicCompareA[详细]
2022-12-24 00:31 分类:问答Atomic swap in GNU C++
I want to verify that my understanding is correct.This kind of thing is tricky so I\'m almost sure I am missing something.I have a program consisting of a real-time thread and a non-real-time thread.I[详细]
2022-12-23 17:53 分类:问答AtomicSwap instead of AtomicCompareAndSwap?
I know that on MacOSX / PosiX systems, there is atomic-compare-and-swap for C/C++ code via g++. However, I don\'t need the compare -- I just want to atomically swap two values. Is there an atomic swa[详细]
2022-12-22 23:45 分类:问答