Kodeco Forums

Video Tutorial: Introducing Concurrency Part 7: Grand Central Dispatch

Learn the basics of Grand Central Dispatch, the low level framework that underlies NSOperation.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/4034-introducing-concurrency/lessons/8

Hello sam, thanks for your video, it’s very helpful.

I have one question:
you’ve said that the main-queue is the short method of user-interactive global queue, does that means these two queues are equal?

But when I test it in my playground, I print out the current thread in the user-interactive global queue task, it shows that the user-interactive global is not running in the main thread.

I don’t quite clear with the main queue and the user-interactive queue, can you help me, thanks.

Hi @studyios

I’m not 100% sure, but I think I might have been mistaken.

I thought I’d read this in the documentation, but for the life of me, I can’t find that information any more.

My apologies!

sam

Hi @nomo,

You should take a look at the next video in the series:

https://videos.raywenderlich.com/courses/introducing-concurrency/lessons/9

It covers dispatch groups, which allow you to track completion of multiple tasks on GCD queues. You could wrap your code up in a dispatch group and then wait for that group to finish before starting the next.

sam

dispatch_queue_attr_t has been removed from the source code. I cant figure out what I can replace it with where neither DISPATCH_QUEUE_CONCURRENT or “Serial” work. Any ideas Sam?

Hi @richardepitts

I suggest that you take a look at the updated version of this series:

https://videos.raywenderlich.com/courses/55-ios-concurrency-with-gcd-and-operations/lessons/1

That’s fully up-to-date with Swift 3, and I don’t think there will be any meaningful differences when Swift 4 is released in a few weeks time.

sam