
W dniu 24 lipca 2010 03:01 użytkownik Chris Morgan <chris.morganiser@...400...> napisał:
- Stability: if Inkscape crashes, all windows from that process die.
At times I have intentionally run multiple instances of the same version of Inkscape, because I'm doing something which I know to be a sensitive crash-causing issue and I don't really want to pull down my other document at the same time. (Don't worry, I've reported the bug each time :P)
There are only two sane approaches: 1. Open every document in the existing instance. 2. Open each document in a separate instance.
Advantages of #1: - faster opening of documents - sharing of common data = lower memory use - libunique simplifies the implementation Disadvantages of #1: - crash in one window destroys the unsaved work in all other windows - needs extra care to ensure that different versions of the executable can be run side by side - libunique might not work on Windows
Advantages of #2: - better stability: crash will only destroy unsaved work in the window that crashed - different versions of the executable can be run side by side naturally - easy to implement 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 - needs a way to synchronize the preferences between instances, otherwise the last instance to quit will overwrite changes from other instances - might interfere with DBus extension API (?)
Commercial vector editors usually go for #1. IMO the preferences issue is the largest obstacle to #2. It means we have to use IPC in both cases, but in #1 we only use it to tell the running instance what to open. In #2 we have to synchronize a lot of settings over the lifetime of the application and propagate change notifications to all instances.
2010/7/24 bulia byak <buliabyak@...400...>:
Agreed. In addition to all the reasons you listed, I think it's simply not the business of the application to fuss about instances.
It is not the business of the user, because most users do not know what an application instance is and how it's different from a window. But the application cannot ignore this issue. Otherwise we get really weird behavior.
W dniu 24 lipca 2010 08:52 użytkownik Jasper van de Gronde <th.v.d.gronde@...528...> napisał:
Again this depends on how exactly this functionality would be implemented. Specifically, in the case of Inkscape I would be inclined to go with a model where it only avoids launching duplicates of the exact same executable.
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.
Regards, Krzysztof