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.

Which is the best of GCD, NSThread or NSOperationQueue?

What's the best way of multithreading in iOS as we have three options GCD, NSThread, and NSOperationQueue? I am confused …

ios multithreading grand-central-dispatch nsthread nsoperationqueue
Simple GCD Serial Queue example like FIFO using blocks

I read Apple documentation on how to Use serial queues to ensure that tasks to execute in a predictable order …

ios objective-c-blocks grand-central-dispatch
Grand Central Dispatch (GCD) vs. performSelector - need a better explanation

I've used both GCD and performSelectorOnMainThread:waitUntilDone in my apps, and tend to think of them as interchangeable--that is, performSelectorOnMainThread:…

iphone objective-c multithreading ios grand-central-dispatch
How to stop a DispatchWorkItem in GCD?

I am currently playing around with Grand Central Dispatch and discovered a class called DispatchWorkItem. The documentation seems a little …

swift grand-central-dispatch cancellation dispatchworkitem
Waiting for multiple asynchronous download tasks

I want to download some files, for example 100 files, at the same time. So I decided to add my download …

ios multithreading swift grand-central-dispatch
OperationQueue.main vs DispatchQueue.main

When you need to perform something on the main thread in the completion block of a networking task or an …

ios swift grand-central-dispatch nsoperationqueue ui-thread
Perform on Next Run Loop: What's Wrong With GCD?

I'm trying these two approaches: dispatch_async(dispatch_get_main_queue(),^{ [self handleClickAsync]; }); and [self performSelector:@selector(handleClickAsync) withObject:nil …

objective-c ios asynchronous grand-central-dispatch
Grand Central Dispatch (GCD) with CoreData

I'm using Grand Central Dispatch (GCD) in my application to do some heavy lifting. The application is using Core-Data for …

iphone core-data objective-c-blocks grand-central-dispatch
Run repeating NSTimer with GCD?

I was wondering why when you create a repeating timer in a GCD block it doesen't work? This works fine: …

ios objective-c grand-central-dispatch nstimer nsrunloop
When to use Semaphore instead of Dispatch Group?

I would assume that I am aware of how to work with DispatchGroup, for understanding the issue, I've tried: class …

ios swift grand-central-dispatch semaphore