[Geany-devel] Race condition when saving geany.conf

Eugene Arshinov earshinov at xxxxx
Tue Mar 2 13:02:48 UTC 2010


On Wed, 24 Feb 2010 20:11:43 +0300%
Dimitar Zhekov <hamster at mbox.contact.bg> wrote:

> On Wed, 24 Feb 2010 12:04:20 +0300
> Eugene Arshinov <earshinov at gmail.com> wrote:
> 
> > When several instances of Geany quit in the same time, there is a
> > high possibility of a conflict. [...]
> > 
> > I can see two solutions for this problem. [...]
> > 
> 
> On Wed, 24 Feb 2010 22:02:55 +1100
> Lex Trotman <elextr at gmail.com> wrote:
> 
> > You see, I'm forgetful, if I had more than one Geany running (and I
> > can see good reasons to do that) then I may forget which one is the
> > "master" and change a preference in a different instance, so what
> > happens to the conf file?
> 
> Perhaps a third solution is possible.
> 
> On Save Yourself:
> 
> 1. Temporarily clear Project Based Session Files.
> 2. Save the configuration as smclientid.conf instead of geany.conf.
> 3. Don't save the project - all it's settings are saved when the
> project is configmed, and the .conf file will take care of the
> filelist.
> 
> On startup, with an smclientid argument present:
> 
> 1. Temporarily clear Project Based Session Files.
> 2. Load the configuration from smclientid.conf instead of geany.conf.
> 3. Don't load anything else. That should happen more or less 
> automatically, once you don't load geany.conf.
> 
> The smclientid.conf file may be removed after loading, or with the XSM
> DiscardCommand.
> 
> 
> As far as I can tell, that will avoid any conf/project races, save the
> file list and all per-file Geany options (Read Only, Wrap, ...) no
> matter if they are part of a project or not, and even save the main
> options per-instance. Plus, it doesn't seem very hard to write, at
> least to me.
> 

Hi.

I'm not sure I understand you message correctly, but the problem I
described is about saving the global Geany settings, not about the way
how to pass instances' settings "across restarts".

The latter is an important topic too, but I can see no significant
problems with the behaviour accepted in the different branch of this
thread. There are some problems, like an example below, but they aren't
worth solving because users will be aware that settings are stored
only by the "main instance" and won't edit settings in "new instances".
And the global settings will be always correctly restored from geany.conf.

[An example insignificant problem] If you change something in an
instance run with "-i" and restart, you'll loose your changes as they
won't be saved anywhere.

Best regards,
Eugene.



More information about the Devel mailing list