LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Windows API atomic operation compatibility in Linux (https://www.linuxquestions.org/questions/programming-9/windows-api-atomic-operation-compatibility-in-linux-708335/)

lennyk 03-01-2009 02:35 AM

Windows API atomic operation compatibility in Linux
 
Hi,

I'm looking for a Linux counterpart of the following windows API calls:
InterlockedExchangePointer
InterlockedCompareExchangePointer

I'm familiar with the atomic_ops library, but it doesn't support the atomic operation I've mentioned above.

Thanks,
Lenny.

paulsm4 03-01-2009 08:17 PM

Hi -

AFAIK, there's no exact equivalent API - but you should be able to create an equivalent in three or four lines: all the necessary primitives are available.

atomic ops is certainly a good place to start.

This link might help:
http://www.linuxquestions.org/questi...-linux-672852/


All times are GMT -5. The time now is 07:43 AM.