• 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: NSWindow in threads
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSWindow in threads


  • Subject: Re: NSWindow in threads
  • From: Mike Abdullah <email@hidden>
  • Date: Tue, 26 May 2009 16:03:06 +0100


On 26 May 2009, at 15:51, Joar Wingfors wrote:


On 26 maj 2009, at 07.27, Mike Abdullah wrote:

You've missed the big warning somewhere in the docs that most of AppKit is not threadsafe. Why do you want to create a window on another thread? What is wrong with doing it on the main thread?


Mike,

Your comment is correct in general, but according to the thread safety guidelines you're supposed to be able to create windows on background threads:

<http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/ThreadSafetySummary/ThreadSafetySummary.html#//apple_ref/doc/uid/10000057i-CH12-123364 >

That said, it seems that it's not safe to create views on background threads, so that's at least one thing that's not right in the few lines of code that was quoted.

Wow, I had no idea of this particular aspect of the rules. My suspicion is this exists to accomodate Cocoa's ability to use window objects for caching a view's contents to an image. Maybe the act of showing a window is what is breaking on a secondary thread.


_______________________________________________

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: NSWindow in threads
      • From: Joar Wingfors <email@hidden>
References: 
 >NSWindow in threads (From: Mattias Jansson <email@hidden>)
 >Re: NSWindow in threads (From: Mike Abdullah <email@hidden>)
 >Re: NSWindow in threads (From: Joar Wingfors <email@hidden>)

  • Prev by Date: Re: Displaying a number with Quartz
  • Next by Date: Re: Core data, bindings and multiple view NIBs
  • Previous by thread: Re: NSWindow in threads
  • Next by thread: Re: NSWindow in threads
  • Index(es):
    • Date
    • Thread