Atomicity of assignment can be achieved using System.Threading.Interlocked
Interlocked.Exchange(ref toItem, fromItem); But how is it atomically to get an instance of a class atomically, because System.Threading.Interlocked does not have the Read(ref object) method, only Read(ref long) ?
TObject obj = somethingObject; //Сомнение атомарности. //Поскольку передача указателя x64 не умещается в такт процессора, //и не гарантирует атомарности. please do not give examples with lock , since they are not interesting to me.