[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: gEDA: Autosave backups
El dom, 06-11-2005 a las 19:42 -0500, Ales Hvezda escribiÃ:
[snip]
> >P.S.: Ales, could you tell more about the bug you found in the last
> >FreeDog meeting?
>
>
> I had the following assertion fire during the meeting:
>
> g_assert(toplevel->page_head != NULL && toplevel->page_head->pid == -1);
>
> in s_page_autosave. I also saw some random crashes here and there.
> I'm not 100% sure that my code changes are completely correct, but the
> autosave mechanism has at least one problem. I think the autosave
> mechanism should be changed so that it doesn't autosave inside the timer
> callback, since _none_ of the libgeda/gschem code is multithread safe.
> You can still use a timer callback which sets a flag and then this flag is
> tested and acted upon in o_undo_savestate(). I picked o_undo_savestate()
> since that is where you are pretty much guaranteed to have the program
> (and all the data structures) in a known good state. gschem and friends
> have been historically single thread and I really would not introduce
> multi-threading issues at this point in time.
>
> Let me know if you need me to clarify this further. Thanks,
Changed in CVS. Now the autosave is done within o_undo_savestate, so
backups will ONLY be saved when there was a change to the
schematic AND there was a timeout of the autosave timer.
I have tested the changes with an autosave interval of 1 second, and
doing a lot of changes to the schematic for some minutes. I didn't get
any warning, so I hope they are ok now.
Please let me know if you have any problem. Regards,
Carlos