Re: Best Strategy to Control iTunes
Re: Best Strategy to Control iTunes
- Subject: Re: Best Strategy to Control iTunes
- From: Bill Bumgarner <email@hidden>
- Date: Wed, 01 Apr 2009 14:07:38 -0700
On Apr 1, 2009, at 2:04 PM, ammar.ibrahim wrote:
Right now, I'm more confused than I was, hehe. My question is: Why
would I
care about thread safety? Assuming that everytime I communicate
with iTunes
I create a thread and have the communication happen from there,
even if it's
blocking and times out, it wouldn't affect my main application. I'm I
missing anything here? How would be the command line application any
different from this?
Simply because you isolate your use of the AppleScript API to a thread
does not make the API safe to use from that thread. You have no
control over what other bits of framework infrastructure might tickle
the thread-unsafe parts of the target API while updating the UI or
responding to user events.
By isolating the code to a subprocess -- a command line application --
it can be both single threaded and isolated from your application's
threads.
b.bum
_______________________________________________
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