I'm looking for some sort of an add-operation working on atomic doubles. Sadly:
myatomdouble += toadddouble;
myatomdouble = myatomdouble + toadddouble;
gets screwed by multithreading and fetch_add is only available for integral types, but not for doubles. But something like fetch_add would be exactly what I need. :(
and mutexing every attempt to modify the variable makes the program superslow, the code unreadable and destroys the idea of atomic.
So is there any solution for this problem?