views:

34

answers:

1

I am making a download and installing application that must run multiple times at the same time. However, is it smart to do so? My application uses the /tmp directory to save temporary downloads. Each instance of the application needs its own dock icon, that's the reason I use multiple instances.

Is it dangerous to have multiple instances of the same application running at the same time? Why or why not? Thanks.


No, I cannot use Installer.app. And yes, it's about a Mac!

+3  A: 

As long as you don't modify the same resources (without precaution) you're fine.

You can easily start several instances of (almost ?) any Mac app, via the terminal. For example, type this several times into the shell:

/Applications/Calculator.app/Contents/MacOS/Calculator &

Everytime you press enter you'll see yet another calculator open. It's only Finder/open that only start an app once.

DarkDust
Yep, I do check the `/tmp` and `/Applications` directories, which are the only directories I use in my application, but what about Cocoa-bindings and user preferences?
Time Machine
I don't know about them, but my guess that the last `[[NSUserDefaults standardUserDefaults] synchronize]` wins and overwrites the others :-)
DarkDust
The little problem I have with that is that I pass command line options using NSUserDefaults: http://unixjunkie.blogspot.com/2006/07/command-line-processing-in-cocoa.html and those may not be changed, of course. Oh, of course, I could save them in a variable. (:
Time Machine