Re: mutex error while throttling down a phenom CPU

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

 



Am Montag, den 19.01.2009, 00:26 +0100 schrieb Kevin Kofler:
> Only system mutexes (POSIX, OpenMP etc.) and some GCC extensions (e.g.
> __sync_fetch_and_add) are guaranteed to be thread-safe, custom hacks can
> often be a source of trouble (and I'm not sure volatile is a complete fix -
> for counters, it can even be counterproductive, as it normally generates
> read/add/write sequences, not in-place adds).

Thanks. I do not need atomic counters. I need only the counter to be set
to its new value before setting the boolean. But, as I have learned
from parallel programming: If one needs atomic counters, he mostly needs
atomic increase-and-check or atomic decrease-and-check. But that
functions seem not to be provided by atomic.h. Are they provided 
elsewhere? Simple atomic increases or atomic decreases are without 
need, in most cases.

Joerg Bergmann

-- 
fedora-test-list mailing list
fedora-test-list@xxxxxxxxxx
To unsubscribe: 
https://www.redhat.com/mailman/listinfo/fedora-test-list

[Index of Archives]     [Fedora Desktop]     [Fedora SELinux]     [Photo Sharing]     [Yosemite Forum]     [KDE Users]

  Powered by Linux