Re: Can I use OSEnqueueAtomic & OSDequeueAtomic from user mode?
Re: Can I use OSEnqueueAtomic & OSDequeueAtomic from user mode?
- Subject: Re: Can I use OSEnqueueAtomic & OSDequeueAtomic from user mode?
- From: Quinn <email@hidden>
- Date: Mon, 19 May 2003 11:01:40 +0100
At 11:10 -0700 18/5/03, Shawn Erickson wrote:
Can I use OSEnqueueAtomic & OSDequeueAtomic from user mode?
No. There are, however, numerous atomic operations available from
various user space frameworks. The two that I'm familiar with are
those in "DriverSynchronization.h" and "OpenTransport.h".
Do not roll your own atomic operations using PowerPC lwarx and stwcx
instructions. This recommendation, from an old technote, still
applies.
DTS recommends that developers avoid using the PowerPC Load Reserved
and Store Conditional instructions. There are two reasons for this.
Firstly, these instructions are inherently processor-specific and
reduce the portability of your code. Secondly, the behavior of these
instructions varies between PowerPC CPU types. Accommodating all
these variations is tricky. These instructions do not provide much
utility beyond that provided by the Open Transport and
DriverServicesLib atomic routines, and Apple ensures that these
atomic routines are updated to do the right thing in all cases.
-- <
http://developer.apple.com/technotes/tn/tn1137.html>
S+E
--
Quinn "The Eskimo!" <
http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.