سؤال

I want to swap two byte arrays atomically, without the need for a lock. i.e. I don't want to do

    byte[] src;
    byte[] dest;
    lock(synchLock)
    {

       dest = src;
    }

Is this possible with Interlocked.Exchange ? I see it works for int arrays in docs.

Thanks!

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top