Created by: richardjrossiii
This makes -defaultExecutor
only run on a background thread if 10% or less of stack space is remaining.
This is significantly faster over a long chain of tasks, as we do not needlessly switch thread contexts, as well as being slightly faster than using NSThread
's thread-local dictionary.
The implementation is semi-portable, and should work on all Darwin-based systems, and will work on other platforms with minor tweaking of pointer math.