Main aspect of the question: It\'s about iOS. Can I somehow dispatch code blocks in a way, that they will all (a) run in background and (b) on the same thread?
Never tried this but this might do the trick. Use separate properties of atomic
dispatch queues for each operation.
@property (strong, atomic) dispatch_queue_t downloadQueue;
Queue/Thread 1 for first operation
downloadQueue = dispatch_queue_create("operation1", NULL);
etc.
Since atomic
is thread safe, downloadQueue
should not be accessed by other threads. So it makes sure that there will be only single thread per operation and other threads will not access it.