FAQ Database Discussion Community

Best, thread safe way to access a field once i.e. for disposal

Basically I want to make sure a field in a class (in this case the _changedPoller) is Disposed as early as possible when not needed anymore. I call StopChangedPolling in the class' Dispose method and when certain events occur. What is the best, thread safe way to dispose a field...

Should I use Interlocked.Exchange here or is a standard write sufficient?

The following method attempts to obtain a lock which is shared with some other thread. In the event that the lock can be obtained within a time period, some Action will be executed. If the lock cannot be obtained within the specified time period, I want to try the whole...

Why isn't atomic double fully implemented

My question is quite simple. Why isn't std::atomic<double> implemented completely? I know it has to do with interlocked variable access. But I really don't see, why this shouldn't be possible on a double. It's specified that any trivially copyable type can be used. And of course double is amongst them....