Grand Central Dispatch(GCD)-part 2

Ali Jaber
May 21, 2021

--

Here we are, back to talk about GCD, let start by discussing the Terms ‘Synchronous’ and ‘Asynchronous’.

Synchronous and Asynchronous:

The threat that will implement this task, will wait till the task is over to return the control. It will block the current thread from executing another task until it’s done. While Asynchronous will not wait, it will directly return control, the task will start but not waiting for it to be completed, and will not block the thread from proceeding another function.

To Use Synchronous, just type as follow:

To use asynchronous, type as follow:

The last topic we will discuss is how to delay a task execution.

Thanks for reading, i hope you enjoyed and learned something new, feel free to leave any comment or question.

--

--

Ali Jaber
Ali Jaber

Written by Ali Jaber

iOS Engineer with more than 3 years experience in developing mobile apps in both swift and objective C for both local and international customers

No responses yet