• 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: Philippe Sismondi <email@hidden>
  • Date: Sat, 20 Mar 2010 07:24:46 -0400

Thanks all. Those suggestions help.

BTW, I inherited the code that does the offending "while" loop. It came from someone's previous attempt to solve exactly one problem: that the secondary thread might finish before the main thread's modal window was even up. I hope I  have solved this by starting the thread in the window delegate method windowDidBecomeKey.

Otherwise I have written it so there is no interaction between the threads except for (1) cancellation, (2) the final data that is passed back to the main thread. On cancellation I do use [NSApp abortModal] from the secondary thread, but that is specifically suggested by the Apple documentation. I am now guardedly confident that I have no lurking race conditions etc.

Had I not been compelled to support OS X 10.4 I would have re-written the whole thing to use something better than threads - GCD or NSOperationQueue capabilities are said to be safer, although I have not yet learned them.

I think this one is resolved for me. Thanks again.

Best,

- Phil -_______________________________________________

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: Chris Hanson <email@hidden>
References: 
 >App modal window and secondary thread (From: Philippe Sismondi <email@hidden>)
 >Re: App modal window and secondary thread (From: Jens Alfke <email@hidden>)
 >Re: App modal window and secondary thread (From: Philippe Sismondi <email@hidden>)
 >Re: App modal window and secondary thread (From: Jens Alfke <email@hidden>)
 >Re: App modal window and secondary thread (From: Andrew James <email@hidden>)

  • Prev by Date: Save As core data question
  • Next by Date: Re: CoreData database sharing and migration
  • Previous by thread: Re: App modal window and secondary thread
  • Next by thread: Re: App modal window and secondary thread
  • Index(es):
    • Date
    • Thread