• 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: App modal window and secondary thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: App modal window and secondary thread


  • Subject: Re: App modal window and secondary thread
  • From: Jens Alfke <email@hidden>
  • Date: Fri, 19 Mar 2010 13:56:41 -0700


On Mar 19, 2010, at 9:30 AM, Philippe Sismondi wrote:

while (![NSApp modalWindow]) // probably not thread-safe, but harmless??
NSLog(@"polling for modalWindow....");

That's a bad idea, I think. You're making an assumption about NSApplication's implementation (I can think of several ways that this method might be dangerously non-thread-safe), and you're also creating a spin-loop that's going to chew up a lot of CPU while it's running.


I couldn't really follow your argument about why you have to do this. You're already not starting the background thread until the modal window pops up.

—Jens_______________________________________________

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: App modal window and secondary thread
      • From: Philippe Sismondi <email@hidden>
References: 
 >App modal window and secondary thread (From: Philippe Sismondi <email@hidden>)

  • Prev by Date: Re: NSComboBox problem in 10.6.2
  • Next by Date: Re: App modal window and secondary thread
  • Previous by thread: App modal window and secondary thread
  • Next by thread: Re: App modal window and secondary thread
  • Index(es):
    • Date
    • Thread