Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Race condition in libkern's OSAtomicDequeue()



On Dec 7, 2005, at 5:57 AM, Nikita Danilov wrote:
Colin Hirsch writes:
I have now found an implementation using LL/SC for the PPC in the Darwin
kernel, however what disconcerts me is the fact that the erronous CAS
based solution is still part of the kernel source(!), and that AFAIK x86

I wouldn't call it "erronous", it is just that it assumes that certain protocol guaranteeing that no ABA ever happens is followed by its clients.

does not have LL/SC instructions [and a whole bunch of other read- modify-
write instructions can be made atomic with a lock prefix] - I posted a bug

LL/SC cannot be emulated through x86 lock prefix, if that's what you are
talking about.

I'd say:

(1) IMO, it's a bug; thanks for filing the bug report, Colin; do you have the # handy? I'd like to look at it...

(2) You can implement LL/SC from either RLL/RSC or CAS primitives:

Efficient and practical constructions of LL/SC variables
Annual ACM Symposium on Principles of Distributed Computing
Proceedings of the twenty-second annual symposium on Principles of distributed computing
Prasad Jayanti, Srdjan Petrovic - Dartmouth College Hanover, NH


You can access the paper through the ACM portal, or from www.cs.dartmouth.edu/~spetrovic/papers/podc_LLSC.pdf

There's also a 2004 IBM research report on using CAS at www.research.ibm.com/people/m/michael/RC23220.pdf

-- Terry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-kernel/email@hidden

This email sent to email@hidden
References: 
 >Race condition in libkern's OSAtomicDequeue() (From: Colin Hirsch <email@hidden>)
 >Re: Race condition in libkern's OSAtomicDequeue() (From: Kevin Van Vechten <email@hidden>)
 >Re: Race condition in libkern's OSAtomicDequeue() (From: Nikita Danilov <email@hidden>)
 >Re: Race condition in libkern's OSAtomicDequeue() (From: Colin Hirsch <email@hidden>)
 >Re: Race condition in libkern's OSAtomicDequeue() (From: Nikita Danilov <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.