• 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: setNeedsDisplay broken in Tiger
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setNeedsDisplay broken in Tiger


  • Subject: Re: setNeedsDisplay broken in Tiger
  • From: John Stiles <email@hidden>
  • Date: Wed, 25 May 2005 10:33:23 -0700

On May 25, 2005, at 7:00 AM, Andrew Thompson wrote:

It's not that way, you're mistaken.  Calling setNeedsDisplay: doesn't cause anything to happen immediately either, but it's not safe to call from random threads whenever you want to.  Read the docs, when a view is set as needing display, it will be displayed during the next pass of the event loop.



That makes perfect sense, it just leaves me wondering why what's presumably such a simple method wouldn't be thread safe. One wonders if it's an efficiency thing - assuming it's just a boolean flag, then you'll have problems unless NSLock (or possibly volatile) is used to make the changes visible across threads. Or maybe it's something else entirely. 


Well, to truly call it "thread safe," you'd need to handle other threads interacting with that HIView at the same time as your code interacts with it--i.e. what if you call setNeedsDisplay while another thread is currently rendering, resizing, moving, or otherwise altering the view? You have to account for anything that might put the NSView object in an unstable state.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >setNeedsDisplay broken in Tiger (From: John Nairn <email@hidden>)
 >Re: setNeedsDisplay broken in Tiger (From: Troy Stephens <email@hidden>)
 >Re: setNeedsDisplay broken in Tiger (From: Troy Stephens <email@hidden>)
 >Re: setNeedsDisplay broken in Tiger (From: Andrew Thompson <email@hidden>)
 >Re: setNeedsDisplay broken in Tiger (From: Bob Ippolito <email@hidden>)
 >Re: setNeedsDisplay broken in Tiger (From: Andrew Thompson <email@hidden>)

  • Prev by Date: Re: nsbundle and nspersistentdocument
  • Next by Date: Re: Working set bloat in Xcode 2
  • Previous by thread: Re: setNeedsDisplay broken in Tiger
  • Next by thread: AppleScript: Returning object references in Cocoa
  • Index(es):
    • Date
    • Thread