Your SlideShare is downloading. ×
Gcd(i os & os x 멀티스레딩 기법)
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Gcd(i os & os x 멀티스레딩 기법)

206
views

Published on

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
206
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. GCD (Grand Central Dispatch) iOS & OS X 멀티스레딩 기법 2013. 11. 아프리카TV 기술연구소 모바일개발팀 전임연구원 정창욱
  • 2. Concurrent, Multi threading and processing ● OpenMP ● OpenCL ● GCD
  • 3. GCD의 특징 ● Multi Thread and Processing 코드를 간결하 고 쉽게 구현 가능 ● C 언어로 되어 있는 Thread 관리 기술 ● C 언어의 Block 기반으로 실행 ● OS가 지능적으로 Task(Thread) 스케쥴링
  • 4. GCD - Dispatch Queue Type OS kernal Dispatch Queue 4 3 2 1 run worker thread
  • 5. 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
  • 6. GCD - Dispatch Queue Type Serial - Main Dispatch Queue Concurrent - Global Dispatch Queue
  • 7. 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);
  • 8. GCD - 실행 및 제어 ● ● ● void dispatch_async( dispatch_queue_t queue, dispatch_block_t block); void dispatch_barrier_async( dispatch_queue_t queue, dispatch_block_t block); void dispatch_sync( dispatch_queue_t queue, dispatch_block_t block); Concurrent dispatch queue dispatch_async dispatch_async task task task task task task task dispatch_barrier_async 시간
  • 9. GCD - 실행 및 제어 ● void dispatch_apply( size_t iterations, dispatch_queue_t queue, void (^block)(size_t));
  • 10. GCD - 실행 및 제어 ● void dispatch_set_target_queue( dispatch_object_t object, dispatch_queue_t queue); ● void dispatch_after( dispatch_time_t when, dispatch_queue_t queue, dispatch_block_t block);
  • 11. GCD - 실행 및 제어 ● void dispatch_group_async( dispatch_group_t group, dispatch_queue_t queue, dispatch_block_t block); ● void dispatch_group_notify( dispatch_group_t group, dispatch_queue_t queue, dispatch_block_t block);
  • 12. GCD - 실행 및 제어 ● void dispatch_suspend(dispatch_object_t object); ● void dispatch_resume(dispatch_object_t object); ● void dispatch_once( dispatch_once_t *predicate, dispatch_block_t block);