Google Answers Logo
View Question
 
Q: Atomic Compare and Swap Instruction on SGI ( No Answer,   0 Comments )
Question  
Subject: Atomic Compare and Swap Instruction on SGI
Category: Computers > Programming
Asked by: wluebke-ga
List Price: $20.00
Posted: 24 Apr 2004 22:21 PDT
Expires: 26 Apr 2004 21:08 PDT
Question ID: 335746
Hello.  

I need to implement the following function in C/C++ on a multiprocessor SGI.

int CAS(int *x,int old,int newv)
{
   // ... 
}

Ideally, this would be a one-line call to the compare_and_swap_int
function found in sys/atomic_ops.h, but at the top of that file the
following line:

#if _KERNEL && !_STANDALONE && !LANGUAGE_ASSEMBLY

And I'm not compiling the kernel.  :)

This could be done using the li and sc MIPS assembly instructions.

Thanks in advance.

William
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy