• 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: NSImage drawInRect deadlock
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImage drawInRect deadlock


  • Subject: Re: NSImage drawInRect deadlock
  • From: Graham Cox <email@hidden>
  • Date: Thu, 11 Aug 2016 09:49:19 +1000

> On 9 Aug 2016, at 4:05 AM, Andrew Keller <email@hidden> wrote:
>
> In my app, I’m creating thumbnails of images.  To do this in parallel, I’m using the global background dispatch queue:


Just to throw another consideration into the discusion, you don’t say what the thumbnails are being used for.

Typically you might want to display these to the user to browse a collection of images. If that’s the case here, then it might be much more performant to create them only as needed for display, rather than generate a huge batch of them ahead of time. In other words, when an image thumbnail is required *for display*, kick off a thread to fetch it (or display the one you have cached already). This means that first time the user scrolls through the collection, thumbnails will ‘pop in’ to view as each thread completes, but this effect is usually easily tolerated. With scroll pre-fetching you might not even see it at all.

This way your threads are naturally limited by the number of images that are shown at a time, or scrolled newly into view.

—Graham



_______________________________________________

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: NSImage drawInRect deadlock
      • From: Doug Hill <email@hidden>
References: 
 >NSImage drawInRect deadlock (From: Andrew Keller <email@hidden>)

  • Prev by Date: Re: Dynamic-width Collection View
  • Next by Date: Re: NSImage drawInRect deadlock
  • Previous by thread: Re: NSImage drawInRect deadlock
  • Next by thread: Re: NSImage drawInRect deadlock
  • Index(es):
    • Date
    • Thread