An atomic operation is an operation that is carried out in a single execution step, without any chance that another thread gets control.In general, this approach only works if the shared resource consists of a single instance of a core data type, such as a string variable, a number, or a list or dictionary.