• 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: NSBitmapImageRep caching behavior in Snow Leopard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSBitmapImageRep caching behavior in Snow Leopard


  • Subject: Re: NSBitmapImageRep caching behavior in Snow Leopard
  • From: John Horigan <email@hidden>
  • Date: Sun, 27 Sep 2009 21:52:02 -0700

It is a digital art program where the user writes a description of an image and the program creates it. Image creation can be a lengthy process so I have the rendering thread periodically send a snapshot of what it has done so far to the view. This is purely to entertain the user while they wait for their image to finish.

What really happens is that the main thread has an NSTimer that tells it when to request an new snapshot. When this timer event fires the main thread sets a flag. The render thread checks this flag when it is at a good stopping point. When the render thread sees that the flag is set it send a message back to the main thread and waits for the message to complete. So the view is in control, it just needs to quiesce the rendering thread before it takes the snapshot.

-- john

On Sep 27, 2009, at 9:18 PM, Kyle Sluder wrote:

Overall your approach seems backwards.  Why is your render thread
telling your view when to draw itself?  The view should be in control
of when it is drawn.  This fits in with your scenario, which appears
to be a clear-cut example of the producer-consumer model.

--Kyle Sluder

_______________________________________________

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


References: 
 >NSBitmapImageRep caching behavior in Snow Leopard (From: John Horigan <email@hidden>)
 >Re: NSBitmapImageRep caching behavior in Snow Leopard (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Can an app query the values in its own Info.plist?
  • Next by Date: Re: Can an app query the values in its own Info.plist?
  • Previous by thread: Re: NSBitmapImageRep caching behavior in Snow Leopard
  • Next by thread: Re: NSBitmapImageRep caching behavior in Snow Leopard
  • Index(es):
    • Date
    • Thread