iOS 10 Screencast: Thread Sanitizer

Another great addition to Xcode 8 is the Thread Sanitizer. It automatically detects race conditions (multiple threads reading/writing to the same memory).

Source: iOS 10 Screencast: Thread Sanitizer

Advertisements

The GCD Handbook

Although most people are familiar with dispatch_async GCD provides much more than that. The API isn’t easy to understand so this post will help you figure out how and when to use it. Includes lots of interesting code samples like implementing a multiple-readers-single-writer Map.
http://khanlou.com/2016/04/the-GCD-handbook/

Common questions on AsyncTask

Colt McAnlis answers some of the most common questions about AsyncTasks. For example: “Should I use a WeakReference to the activity?”. Must read for Android developers.
View story at Medium.com

Concurrent Memory Deallocation in the Objective-C Runtime

Another great post from Mike Ash. This time on how the deallocation of method implementations is implemented in Objective C. It starts with details on how the basic objc_msgSend works and then suggests a few alternatives for clearing the methods cache. Finally arriving to Apple’s implementation which is really interesting and not common. A lot of details but don’t worth every minute.
https://www.mikeash.com/pyblog/friday-qa-2015-05-29-concurrent-memory-deallocation-in-the-objective-c-runtime.html

Why Spinlocks Are Bad On iOS

Starting with what are Spinlocks how they work and when you should avoid them (usually). Although this is iOS specific the discussion is mostly relevant for all platforms.
http://engineering.postmates.com/Spinlocks-Considered-Harmful-On-iOS/

HandlerThreads and why you should be using them in your Android apps

A great post on how and when to use HandlerThreads. As the author mentions, this utility class is not very well documented but it can be useful in many use cases.
View story at Medium.com

Thread Safety Basics on iOS/OS X

A new post from Parse on thread safety. A good read to learn or refresh your knowledge on the basics of thread safety. Starts with defining Concurrency, Reentrancy, Atomicity and follows with solutions and short code samples.

Thread Safety Basics on iOS/OS X

Thread Scheduling in Android

A short and to-the-point post about Threads scheduling in Android. Don’t miss: if you create your own Threads or ExecutorServices you might need to change the default priority.
http://www.androiddesignpatterns.com/2014/01/thread-scheduling-in-android.html