[perf-discuss] Re: Is the following CAS(Compare and Swap ) function preserves atomicity?

2006-03-22 Thread Rama Krishna
In our solaris system atomic_cas( ) is not available in user space,to make it available we require to download some of the patches. So we are making use of our own atomic primitive. Base on your guidance we are trying to modify our primitive to make use of CMPXCHG instruction. As atomic

[perf-discuss] Is the following CAS(Compare and Swap ) function preserves atomicity?

2006-03-21 Thread Rama Krishna
Hi, Below is the atomic function of compare and swap instruction (CAS) written in assembly code. The following is general description of the function for CAS(int *p,int n,int k) which does if(*p == n) { *p = k;