Top "Grand-central-dispatch" questions

Grand Central Dispatch (GCD) provides a simple and robust mechanism for concurrent and asynchronous operations, primarily in Apple operating systems (e.g., iOS, macOS, watchOS, and tvOS), but also FreeBSD and MidnightBSD.

dispatch_get_global_queue behaviour

The following code: dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ for (int i=0; i<100000; i++) { NSLog(@"…

iphone grand-central-dispatch
Using dispatch_async with self

I have run into this problem a few times while porting Objective-C code to Swift. Say I have the following …

grand-central-dispatch swift
Whither dispatch_once in Swift 3?

Okay, so I found out about the new Swifty Dispatch API in Xcode 8. I'm having fun using DispatchQueue.main.async, …

swift grand-central-dispatch swift3 libdispatch
Suspending GCD query problem

i have trouble suspending a gcd query. Here is some code that demonstrates the problem: static dispatch_queue_t q=…

objective-c grand-central-dispatch
How to asynchronously load an image in an UIImageView?

I have an UIView with an UIImageView subview. I need to load an image in the UIImageView without blocking the …

ios objective-c uiimageview grand-central-dispatch
Why can't we use a dispatch_sync on the current queue?

I ran into a scenario where I had a delegate callback which could occur on either the main thread or …

objective-c multithreading objective-c-blocks grand-central-dispatch
Operation Queue vs Dispatch Queue for iOS Application

What are the differences between Operation Queue and Dispatch Queue? Under what circumstances will it be more appropriate to use …

iphone objective-c ios cocoa-touch grand-central-dispatch
How to stop/cancel/suspend/resume tasks on GCD queue

How to stop/cancel/suspend/resume tasks on GCD queue How does one stop background queue operations? I want to …

ios queue grand-central-dispatch
Perform UI Changes on main thread using dispatch_async or performSelectorOnMainThread?

Possible Duplicate: Grand Central Dispatch (GCD) vs. performSelector - need a better explanation To execute "stuff" on the main thread, …

ios objective-c asynchronous grand-central-dispatch nsthread