First off, it's “Mac OS X” or “OS X”. There is no such thing as “OS/X”.
Second, Mac OS X doesn't come with Boost; you would need to bundle it with your application.
Third, most of Carbon is not available in 64-bit. This is a clear signal that those portions of Carbon will go away someday (when Apple abandons 32-bit in its hardware). Sooner or later, you will have to either rewrite your app with Cocoa or abandon the Mac.
Normally an application bundle on OS/X can only be started once, however by simply renaming the bundle the same application can be launched twice.
No it can't. Launching the renamed or moved application will simply activate (bring to the front) the process that was already running; it won't start a new, second process alongside the first one.
There are several ways to tell whether an application is already running. In each case, you do this on launch:
- Use Cocoa's NSConnection to register a connection with a single constant name. This will fail if the name is already registered. (You can use Foundation from a Carbon app; it's the Application Kit you have to be careful with.)
- Use the Process Manager to scan the process list for processes whose bundle identifier match the one you're looking for. The bundle identifier isn't unchangeable, but it's harder to change than the filename or location.
If you're looking to see when someone runs a second copy of yourself, you can use CFNotificationCenter:
- Add yourself as an observer for “com.yourdomain.yourappname.LaunchResponse”.
- Post a notification under the name “com.yourdomain.yourappname.LaunchCall”.
- Add yourself as an observer for “com.yourdomain.yourappname.LaunchCall”.
In your observation callback for the Call notification, post the Response notification.
In your observation callback for the Response notification, exit.
Thus, when the first process starts, it will Call and get no Response; when the second process starts, it will Call, get a Response from the first process, and exit in deference to the first.