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

xchg vs lock



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.