Taking Notes

cause i'll forget

Sync

So if you’ve ever written any concurrent software you’ve had to do some kind of acrobatics to create a Critical Section.

“You have to use (OSAtomic || NSRecursiveLock || @synchronized() || FloppyRubberChicken or you’re doing it wrong” - The Entire Internet (AKA Stack Overflow)

  1. If your logic is written in a way that resource contentions are really a serious ding to your performance, then maybe you need to step back and think about solving things other than how fast your code locks and unlocks.

  2. I do it with dispatch_sync, not because it’s the (Best || Most Perfect || Infallible || Unquestionable) approach possible, but because it’s simple, reliable, and in my experience fast. This may change, and when it does I’ll change to. For now this is how I do business: GIST