Concurrent Computing and Programming with Grand Central Dispatch

Grand Central Dispatch

The Queues

  • Concurrent file: Performs multiple tasks in parallel
  • Sequential or Serial file: performs one-to-one tasks in series
  • Main queue : equivalent to the main thread that primarily handles the application's UI. All of the UI calls must be done on this queue.
  • Global queue : the system provides us with 3 global tails with different priorities (HIGH, DEFAULT and LOW). These 3 files are of the Concurrent type.
  • Custom queue : queues that can be created manually and of the desired type (Serial or concurrent).
source

GCD in Practice

before
after
inside async block
inside main Queue block
finished!

Going Deeper

Starting job 0
Starting job 1
Starting job 2
Starting job 3
Starting job 4
Starting job 5
Starting job 6
Starting job 7
Starting job 8
Starting job 9
Finished job 3
Finished job 2
Finished job 1
Finished job 4
Finished job 0
Finished job 9
Finished job 5
Finished job 6
Finished job 8
Finished job 7
All jobs done!

Conclusion

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Tabcorp Takes to Google Made Flutter For Creating a Smooth Omnichannel Customer Experience

Application Performance Management(APM)

Using Exception.Data property to log user-defined information about exceptions

Web Development Adventures On Hold For Now — Stay Tuned for February 2016

“GitHub Streaks” and Other Coding Habits

Revolutionise your software development lifecycle with Trello (Part 2/4)

{UPDATE} 1 foto examen: juego sobre ejercios imposibles de la mente para entender inteligencia…

Rockside Relayer Security: Smart Contract External Audit by Sekoia

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Thibault Carpentier

Thibault Carpentier

More from Medium

Batch Convert XCode String files, from utf-16 to utf-8

RxSwift Combination Operators: zip, combineLatest & withLatestFrom

Improve your architecture by abstract your code

Generating JWT for AppStore Connect API with JWTKit in Swift