Re: Use of AppKit in command-line app on headless node
Re: Use of AppKit in command-line app on headless node
- Subject: Re: Use of AppKit in command-line app on headless node
- From: "Ken Ferry" <email@hidden>
- Date: Mon, 11 Aug 2008 13:26:15 -0700
Hi Rick,
I think you might be misreading that technote.. what it says is that
trying to guess which methods are and are not safe doesn't work,
because a method that does not happen to require the windowserver in
one release may require it in another. The section you're quoting is
about what to do if you're going to ignore that fact. It's better not
to ignore it.
AppKit in general requires a window server connection. It would be
nice if there was a defined subset that was safe, but there is not at
the moment. There may be exceptions where there is a pledge that
something works without a windowserver connection, but it's going to
be an opt-in situation. That is, unless you see otherwise, it method
is contractually free use the windowserver.
It's possible that NSDocument could make that pledge, but I don't know.
If you're asking about the reality of today's situation rather than
the contract, then yes, many parts of AppKit do require the
windowserver.
-Ken
Cocoa Frameworks
On Mon, Aug 11, 2008 at 11:58 AM, Rick Hoge <email@hidden> wrote:
>
>
>> I am trying to factor some frameworks so that code used in a
>> document-based Cocoa app can be shared with command-line tools that might
>> run on a headless node (no window server).
>>
>> I've seen some discussion in the past on questions such as whether NSImage
>> and related classes can be used headless. It seems that this works, but
>> it's necessary to initialize and NSApplication instance for the classes to
>> work correctly.
>
>
> I noticed that there is some useful info relating to this topic in the
> documentation on Agents and Daemons at
>
> http://developer.apple.com/technotes/tn2005/tn2083.html#SECLIVINGDANGEROUSLY
>
> It does say that AppKit is not daemon-safe, but my testing suggests that if
> (as suggested in the technote) you avoid sensitive methods it should be ok
> (more info would be welcome).
>
> I should also mention that the code in question would potentially be run
> under Xgrid - have not tested this yet; wonder if there could be bootstrap
> namespace issues here...
>
> Rick
> _______________________________________________
>
> 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
>
_______________________________________________
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