Windows on main thread always only sometimes?
Windows on main thread always only sometimes?
- Subject: Windows on main thread always only sometimes?
- From: Jack Repenning <email@hidden>
- Date: Thu, 2 Jul 2009 11:16:48 -0700
I've always been taught that one must only create and run AppKit
objects on the main thread. Recently, though, over in objc-language,
http://lists.apple.com/archives/Objc-language/2009/Jul/msg00002.html
it was pointed out that the threading Programming Guide seems to say
otherwise:
<http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/ThreadSafetySummary/ThreadSafetySummary.html
> says:
"You can create a window on a secondary thread. The Application Kit
ensures that the data structures associated with a window are
deallocated on the main thread to avoid race conditions. There is
some possibility that window objects may leak in an application that
deals with a lot of windows concurrently. You can create a modal
window on a secondary thread. The Application Kit blocks the calling
secondary thread while the main thread runs the modal loop."
But now I notice this only says you can *create* windows from
secondary threads; it doesn't explicitly allow any other action, and
it even refers to several automatic insurances that other things
happen on the main thread.
So what *are* the rules? Is the Thread Safety Summary implicitly
strict, "you can create a window, but absolutely nothing else"? Or is
there some set of other operations that are permitted from the
secondary (and where do I learn those)?
(This may already have been discussed on this list ... surely ... I
tried to search it out first, but unfortunately every message in the
archives matches "thread," due to the navigation links! If so, sorry.)
-==-
Jack Repenning
email@hidden
Project Owner
SCPlugin
http://scplugin.tigris.org
"Subversion for the rest of OS X"
_______________________________________________
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