9. GCD의 특징
● Multi Thread and Processing 코드를 간결하
고 쉽게 구현 가능
● C 언어로 되어 있는 Thread 관리 기술
● C 언어의 Block 기반으로 실행
● OS가 지능적으로 Task(Thread) 스케쥴링
10. GCD - Dispatch Queue Type
OS kernal
Dispatch Queue
4
3
2
1
run
worker thread
11. GCD - Dispatch Queue Type
Serial Dispatch Queue
3
2
1
run
worker thread
Concurrent Dispatch Queue
run
worker thread
3
2
1
run
worker thread
run
worker thread
12. GCD - Dispatch Queue Type
Serial - Main Dispatch Queue
Concurrent - Global Dispatch Queue
13. GCD - 생성 및 얻기
● dispatch_queue_t dispatch_queue_create(
const char *label,
dispatch_queue_attr_t attr);
● dispatch_queue_t dispatch_get_main_queue(void);
● dispatch_queue_t dispatch_get_global_queue(
long priority,
unsigned long flags);