On Sunday 25 July 2010 01:40:13 Jon Cruz wrote:
On Jul 24, 2010, at 3:46 PM, Krzysztof KosiĆski wrote:
There are only two sane approaches:
- Open every document in the existing instance.
- Open each document in a separate instance.
[SNIP]
Disadvantages of #2:
- slower start
- higher memory use - no data can be shared; if we use shared memory,
the crashed instance could have corrupted it and the stability guarantee goes away; possible solution: read-only shared memory, but hard to implement in a portable manner
One possible approach would be to use IPC to instruct a fully loaded inkscape instance to fork and open the other document (which should be faster than starting and fully loading completely new instance and allows OS to share memory for us in a copy-on-write manner). This should reduce loading times while maintaining a separate instance for a document (at the cost that any bad state caused by a bug will be copied to the new instance), at least for systems with reasonable fork implementation, I don't know how forks are emulated on Windows in ported unix applications.
On each build we can generate an UUID to be stored in inkscape-version.cpp and start a new instance if there's no instance with this UUID already running. There's a little more complexity in it, because we need to generate a different exclusion ID for every user session, so if you log in locally, start Inkscape, then lock the screen and log in remotely via SSH, you can start a distinct instance of Inkscape.
We also would need to tie things to different environment variables, etc. If one launches an instance of inkscape with different XDG variables from a current instance of the same version, things still should treat that as 'different'. And there are a few other such factors to consider. So it does look as if UUID itself does not solve the problem.
One such factor that comes into my mind is command line execution in scripts (with or without gui), the environment, user session, UUID, executable file path are not different between uses, while a new instance should probably still be used.
Regards, Martin Sucha