Concorrência no IOS

859 views

Published on

Apresentação sobre concorrência no IOS no QCon SP 2012

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
859
On SlideShare
0
From Embeds
0
Number of Embeds
15
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Concorrência no IOS

    1. 1. Concorrência no IOS @seufagner - Lightning Talk - QConSP 12
    2. 2. • Fagner Moura - @seufagner Developer at moobile / Innvent Java, Ruby, PHP, Javascript, Obj-C, etc• Stanford - 1 mês Madison College - viajo segunda
    3. 3. • Fagner Moura - @seufagner Developer at moobile / Innvent Java, Ruby, PHP, Javascript, Obj-C, etc• Stanford - 1 mês Madison College - mentira...• Estudar C, depois Obj-C e só pouco-depois-durante IOS
    4. 4. user inexperience
    5. 5. qual aopaió! diferença? async é concorrente? concorrente é paralelo? pode ser sync e concorrente?
    6. 6. passado não distante< IOS 3.2NSThread // pthreads - C libNSBlock // mutex
    7. 7. GCD
    8. 8. global dispatch queues
    9. 9. global dispatch queuescustom dispatch queues
    10. 10. global dispatch queues FIFOcustom dispatch queues
    11. 11. global dispatch queues CONCORRENTEScustom dispatch queues
    12. 12. ^blocks, novos-velhos amigosint (^block)(int);(^block)(int);(^block) = ^(int x) { // ... };^ { // ... }^void(void) { // ... };^ { // ... };^int { return 13 };^ { return 13; };
    13. 13. libdispatcher NSOperation
    14. 14. API libdispatcherdispatch_async(dispatch_queue_t, ^(void)block);dispatch_get_global_queue(dispatch_queue_priority_ t, 0);dispatch_get_main_queue();dispatch_queue_create(*char, NULL);dispatch_release(dispatch_queue_t);
    15. 15. NSOperationUsa libdispatcher - IOS5+Gerencia operationsKVO complianceNSOperationQueue
    16. 16. NSOperationNSInvocationOperation NSBlockOperation NSbrublesOperation
    17. 17. • libdispatcher ou NSOperations?• Não confie no atomic - nonatomic• Respeite a main-thread• Cuidado com race conditions• Use blocks!

    ×