Quantcast
Channel: scikit-learn - 盆暗の学習記録
Viewing all articles
Browse latest Browse all 80

Answer by Asciiom for Which is threadsafe atomic or non atomic?

$
0
0

atomic guarantees atomic access to the variable but it DOESN'T make your code thread safe. Neither does non-atomic.

With "atomic", the synthesized setter/getter methods will ensure that a whole value is always returned from the getter or set by the setter, regardless of setter activity on any other thread. So if thread A is in the middle of the getter while thread B calls the setter, an actual viable value will be returned to the caller in A. For nonatomic, you have no such guarantees.


Viewing all articles
Browse latest Browse all 80

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>