Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Temporary Repo for SO Question

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 ThreadingHell.xcodeproj
Octocat-spinner-32 ThreadingHell
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
README.md

ThreadingHell

Overview

I needed to figure out a way to run multiple concurrent calls to fetch "account" information from a backend system.

(I have simplified the logic for this example, but object and method names are the same)

This sample project demonstrates how to use dispatch_group_* methods to provide run necessary code concurrently, while maintaing correct read values when all of the tasks have finished.

Suggestions

There are many different ways to skin this concurrent cat:

  • NSOperation's
  • dispatch_barrier
  • dispatch semaphores

If you have a better/different implemenation then please let me know. I would like to add it to the list.

Something went wrong with that request. Please try again.