Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Concorrência no IOS        @seufagner - Lightning Talk - QConSP 12
• Fagner Moura - @seufagner  Developer at moobile / Innvent  Java, Ruby, PHP, Javascript, Obj-C, etc• Stanford - 1 mês  Ma...
• Fagner Moura - @seufagner  Developer at moobile / Innvent  Java, Ruby, PHP, Javascript, Obj-C, etc• Stanford - 1 mês  Ma...
user inexperience
qual aopaió!         diferença?         async é concorrente?         concorrente é paralelo?         pode ser sync e conco...
passado não distante< IOS 3.2NSThread // pthreads - C libNSBlock // mutex
GCD
global dispatch queues
global dispatch queuescustom dispatch queues
global dispatch queues             FIFOcustom dispatch queues
global dispatch queues     CONCORRENTEScustom dispatch queues
^blocks, novos-velhos amigosint (^block)(int);(^block)(int);(^block) = ^(int x) { // ... };^ { // ... }^void(void) { // .....
libdispatcher            NSOperation
API libdispatcherdispatch_async(dispatch_queue_t, ^(void)block);dispatch_get_global_queue(dispatch_queue_priority_  t, 0);...
NSOperationUsa libdispatcher - IOS5+Gerencia operationsKVO complianceNSOperationQueue
NSOperationNSInvocationOperation  NSBlockOperation NSbrublesOperation
• libdispatcher ou NSOperations?• Não confie no atomic - nonatomic• Respeite a main-thread• Cuidado com race conditions• Us...
Upcoming SlideShare
Loading in …5
×

Concorrência no IOS

914 views

Published on

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

Published in: Technology
  • Be the first to comment

  • Be the first to like this

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!

×