OSX multiple process app

505 views Asked by At

I'm making a network client application for OS X. There's a part of the UI - let's call it the front-end - that starts up network sessions, and then there are the network sessions themselves.

I'd like the application to spawn the sessions into separate processes. In other words, the application will have a single front-end process, and then 0..N session processes. The front-end process will have a full Cocoa UI (NSWindow+menubar etc), but so will the each of the sessions. The sessions will be mostly independent of the front-end once they've been launched - very little interprocess communication is needed.

Here's the tricky bit - I don't want this to appear to be multiple applications. I want the main front-end process as well as all of the session processes to be controlled with a single Dock tile (i.e. click the Dock tile and all of the application windows come up in z-order, as per OS X standard behaviour), I want the application name in the application menu to be the same, and I want the Dock tile to have a window list that corresponds to all of the session windows (being run by separate processes).

This must be possible - Chrome does something very similar. Does anyone have a rough overview of how they think I could accomplish this?

UPDATE: Having looked at this carefully, I'm thinking now that this isn't really possible to do in any clean way. Chrome, in particular, creates all of its NSWindows in a single parent process, and then just marshals page rendering from helper processes. I'll mark this as 'answered' in a couple of days if no one else can add anything.

0

There are 0 answers