Clear that!
Dispatch_async sends a block to a specified thread for execution. The current thread does not wait and will continue to execute.
Dispatch_sync also sends the block to the specified thread for execution, but the current thread will be blocked and the block will continue to be executed after the execution of the specified thread is complete.
So why is dispatch_sync easy to analyze when it is not used at that time, and it is easy to cause a deadlock to the current thread ~
After dispatch_sync and dispatch_async Add the block to the specified thread, the specified thread is executed serially, both FIFO. SoDispatch_sync(Queue, ^ {}); this code still makes sense ~ It will block the current thread and wait until all the tasks in the queue are completed and then run down.
However, it is not necessary to useDispatch_syncWhen I read the online saying "the database needs concurrent I/ODispatch_sync", I still don't know what the scenario is ~ We look forward to making some calls...