I’m trying to understand what Audrey Tam said here Lessen 6: OperationQueue at the 2:57 (2 minutes and 57 seconds) mark:
“If you want to do something when all the operations have finished, set up a private serial dispatch queue, where you can call the operation queues, wait until all operations are finished”. (verbatim)
I don’t understand why you would use a DispatchQueue object to call OperationQueue objects. Did she call something by the wrong name? Did she misspeak? Can someone explain this to me? I would really appreciate it
you got the quote right, that’s what I have in my script, except “operation queues,” should be “operation queue’s” — the slide is showing some of the OperationQueue methods, including waitUntilAllOperationsAreFinished(). Calling this method blocks the thread the operation queue is running on, so you need to move it off the main thread if you want to call it. And the way to do that is to run it in a private serial dispatch queue.
Operation queues and dispatch queues are all part of the same concurrency system. Operation queues use dispatch queues under the hood.