[Geany-devel] Multiple instances of Geany issues

Lex Trotman elextr at xxxxx
Sat May 22 03:21:48 UTC 2010


Hi,

I like time zone differences, I go to bed with a problem and wake up to a
nice patch (or two) to read over breakfast :-) so here's one for you.

The only real solution to potential corruption is to make the writes to
shared config files atomic.  The patch uses the good old fashioned exclusive
lock file method. IIUC this should also work on windows, but may need
registry settings to be correct, I'm not sure.  Nothing else I researched
seemed to be portable.

In race conditions this patch doesn't say which write will win, but it is
intended to guarantee that whichever does will be written atomically and not
corrupted.

In general there is no way Geany can know which write should win, the user
has to do that themselves by closing instances manually in the right order
so the last wins.

The patch has both yours and mine in the one.

Your patches stop new_instances upsetting geany.conf and mine handles shared
project files and geany.conf in the case of multiple main instances.

Lets see if anyone else can get it to fail.

Cheers
Lex

On 21 May 2010 23:52, Dimitar Zhekov <hamster at mbox.contact.bg> wrote:

> There is one more case when geany.conf may be modified by a secondary
> instance: saving the project-less file list on Project -> New / Open.
> Patch attached.
>
> --
> E-gards: Jimmy
>
> _______________________________________________
> Geany-devel mailing list
> Geany-devel at uvena.de
> http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/devel/attachments/20100522/140bfb8b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config_lock_patch.diff
Type: text/x-patch
Size: 5066 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20100522/140bfb8b/attachment.bin>


More information about the Devel mailing list