Concorrência no IOS

  • 541 views
Uploaded on

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

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

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
541
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
4
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
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Transcript

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