• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Silly ARC question - explanation requested
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Silly ARC question - explanation requested


  • Subject: Re: Silly ARC question - explanation requested
  • From: Quincey Morris <email@hidden>
  • Date: Wed, 04 Jun 2014 15:02:46 -0700

On Jun 4, 2014, at 14:45 , Alex Zavatone <email@hidden> wrote:

> But I need to come up with an explanation of explain why that is a bad idea and why it smells

It smells because a computationally intensive while loop will stall the dispatch queue that’s stuck on it.

If you’re programming with *threads*, it’s fine to dedicate a thread to a long-running operation.

If you’re programming with *dispatch queues*, you’re sharing a resource (a CPU) with other applications. Taking the resource over for yourself is detrimental to overall system performance.

Breaking the long task into smaller pieces allows the pieces to be distributed over as many threads as the OS wants to use, and doesn’t deny access to CPUs to other threads and processes.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Silly ARC question - explanation requested
      • From: Alex Zavatone <email@hidden>
References: 
 >Silly ARC question - explanation requested (From: Alex Zavatone <email@hidden>)
 >Re: Silly ARC question - explanation requested (From: Quincey Morris <email@hidden>)
 >Re: Silly ARC question - explanation requested (From: Alex Zavatone <email@hidden>)

  • Prev by Date: Re: Silly ARC question - explanation requested
  • Next by Date: Re: Silly ARC question - explanation requested
  • Previous by thread: Re: Silly ARC question - explanation requested
  • Next by thread: Re: Silly ARC question - explanation requested
  • Index(es):
    • Date
    • Thread