xchg vs lock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

Inside the kernel, I see in many places xchg is used to swap two pointers atomically? What is the difference between exchanging using xchg and getting lock, then exchange, then unlock? Is it only performance reason?

Thanks,


- Meraj


Got a little couch potato?
Check out fun summer activities for kids.

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux