On Dec 9, 2011, at 4:48 PM, Ian Joyner wrote: > You are probably looking for something like Dahm locks (invented by Dave Dahm > on the Burroughs B5000 in the 1960s). Here is a long paper on locks including > this origin: > > http://pages.cs.wisc.edu/~remzi/OSFEP/threads-locks.pdf > > Here is an idea of the ALGOL define for acquire: > > DEFINE > ACQUIRELOCK (ID) = > BEGIN > IF READLOCK (PROCESSID, CONTENDERS[ID]) ^= 0 THEN > DO > PROCURE (LOCKS[ID]) > UNTIL READLOCK (-1, CONTENDERS[ID]) = 0; > OWNERS [ID] := PROCESSID; > END #
I seriously, seriously, seriously doubt that he wants to be implementing locks by translating Algol, *especially* when key, tricky to get correct, routines are not provided. But then again, based on the Windows code he presented, OP has nothing against re-implementing these functions poorly ;-) OSAtomic functions could replace the Interlocked functions. But seriously, what's wrong with the available lock functions? Why in the world would you implement your own locks??? -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice _______________________________________________ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com