A thread-safe FIFO queue for Objective-C. I had intended to build it on OSFIFOQueue, but that doesn't exist for iOS. Then I was gonna implement my own, but lockless queues aren't really possible without a true DCAS instruction, which also doesn't exist. As a result, this is just a somewhat lame wrapper around NSMutableArray
and libdispatch
. It is cool and supports everything, though.
g
DRAtomicQueue
public
6 stars
0 forks
0 issues
Commits
List of commits on branch master.Unverified
54dfc2eb785f33a842f5a178b462801346c3d79bFix conditionals.
ggwynne committed 12 years ago
Unverified
e55bcbf3376b240d3e0ae736f3d648b706de9cd0Add -unPop: method for pushing things back onto the front of the queue. Also made pushing synchronous.
ggwynne committed 12 years ago
Unverified
f9d85e2e938ea0601a9ec5509e84981f632dcbbeAnd another from @mikeash, pointing out that the respondsToSelector: check can be cached.
ggwynne committed 12 years ago
Unverified
0d364c39071f2f1e9272ca9b480ca003c99848a3See previous commit message.
ggwynne committed 12 years ago
Unverified
8c43c136f7576d1a7df1cc544e6ade26ba08f419And thanks to @mikeash a third time for pointing out that -pop was crashing instead of returning nil on an empty queue. And for suggesting -respondsToSelector: to check for secure coding support so builds against 10.7/iOS 5 will use it on 10.8/iOS 6.
ggwynne committed 12 years ago
Unverified
751167e707d4aea970c7a5575682f9a767081babThanks to @mikeash (again!) for pointing out that pathological array contents could deadlock if the encode is done on the queue's queue.
ggwynne committed 12 years ago