Den 23:55 7. mars 2012 skrev Don Quixote de la Mancha <quix...@dulcineatech.com> følgende:
> If you possibly can replace locking algorithms with what are commonly but > incorrectly called lock free algorithms. They use Atomic Arithmetic > Primitives provided by the CPU Instruction Set Archetector to manage very > short term locks on single words of memory. Lock-free algorithms are cool, but keep in mind that they can be hard to implement, so you have to know what you're doing. Once you have forgotten to think of a possible scheduling sequence that might corrupt your data, you have introduced very subtle bugs that can be very hard to track down. If you only stick to well-known algorithms that are well tested, you should be OK, I think. But remember to analyze the whole structure of the app to determine if that algorithm, used the way you intend to use it, does really make it thread safe. I guess this last bit is true whether you use locks or not. To see a list of atomic primitives for OS X apps, start terminal and type man atomic<enter> Per _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com