Re: mutex error while throttling down a phenom CPU

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

 



Joerg Bergmann wrote:
> Solved. gcc did reorder some mutex related counter/bool assignments
> which should be done right in order. They come in from an argument
> pointer, so I did trust this order. Have set them to volatile, that
> did fix the bug. Is this a new gcc feature or a gcc bug?

Optimization feature, most likely.

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).

        Kevin Kofler

-- 
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