Re: Parallel instances of Cocoa apps?
Re: Parallel instances of Cocoa apps?
- Subject: Re: Parallel instances of Cocoa apps?
- From: John Stiles <email@hidden>
- Date: Thu, 13 Sep 2007 10:33:35 -0700
On Sep 13, 2007, at 10:22 AM, Jay Reynolds Freeman wrote:
I need to run multiple copies of a Cocoa application (that
I am writing) at the same time. I can do so fine (perhaps
I should merely say "so far, so good") with straight Unix
stuff, using C code along the lines of
system( "<full path to my application's '.app' file> &" );
That actually seems to work, but I was wondering:
(1) Is there any way to do this with Cocoa routines, and
perhaps more importantly,
(2) Is there any reason *not* to run multiple copies of
the same Cocoa application?
There seems to be a way to run multiple copies of the same
Carbon application, but I couldn't find anything useful
about Cocoa parallel applications in the XCode docs or
on the web, or any indication of why Cocoa does not provide
the same functionality as Carbon.
I am not sure what you mean by this. The OS layer which launches
apps, Launch Services, is development-API agnostic. You can write an
app with any mix of Carbon or Cocoa and it does not know the
difference. And Launch Services also provides an option to launch
multiple copies of the same app at once.
Anyway, getting right to the point—you should use the Launch Services
APIs instead of system(). Many things will work better if you do.
I will caution that launching the same app more than once can
sometimes lead to weird side-effects, but you seem determined to do
it, so it's your call.
(I won't bore you all with whys and wherefores, though I
will be glad to discuss them offline if anyone cares.
It may forestall wasting bandwidth if I mention now that
yes, I do want parallel processes and not just parallel
threads, and no, multiple documents in one instance of
the application are not the way I want to go ...)
-- Jay Reynolds Freeman
---------------------
email@hidden
http://web.mac.com/jay_reynolds_freeman (personal web site)
_______________________________________________
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:
40blizzard.com
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