I have an Objective-C class which spins up a background thread and runs an NSRunLoop on it. I would like to deliver messages to the background thread from the main thread (yes, exclusively from the main thread). To do this, I am planning to use the built-in performSelector:onThread:withObject:waitUntilDone:
.
I am wondering if it is safe to assume that the order in which I send messages this way will be the order in which they are received on the background thread. Obviously, the question is moot if multiple threads are calling performSelector:onThread:withObject:waitUntilDone:
at nearly the same time, but since I will only be calling it from the main thread, am I guaranteed ordered queuing?