[Freeciv-Dev] Re: (PR#3424) New flush code
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Raimar Falke wrote:
> On Tue, Feb 25, 2003 at 11:51:58AM -0800, Jason Short wrote:
>
>>>>>What does this list tell me? You said above that there are two times
>>>>>when flush is called: after the network (easy to implement) and during
>>>>>animation (we have animation for unit combat, unit movement and
>>>>>mushroom). So what is the reason for this list?
>>>>
>>>>No, the two times are:
>>>>
>>>>- Before we hand control back to the GUI main event loop.
>>>>- Before any animation.
>>>>
>>>>After the network code is only one case of #1. For instance, when the
>>>>user clicks a mouse to recenter the mapview, we call
>>>>center_tile_mapcanvas and then we have to flush_dirty (except in gtk2).
>>>> There are about 6 different cases where this type of thing is done
>>>
>>>>from the GUI code.
>>>
>>>>So, the long and complicated list traces the callers of
>>>>dirty_rect/dirty_all back toward the GUI main event loop. At some point
>>>>in between the two, there needs to be a call to flush_dirty. You can
>>>>verify that this is always the case.
>>>
>>>
>>>This sounds cumbersome and error-prone. Can't we put a call to
>>>gui_callback_finished in these callbacks which are called by the GUI?
>>
>>It probably will be cumbersome and error-prone, unfortunately.
>>
>>I don't quite understand your suggestion.
>
>
>>You want every GUI callback to call gui_callback_finished when it's
>>done?
>
>
> Yes.
This seems horrendously inefficient, and a huge amount of work. How
many GUI callbacks are there? Dozens? Hundreds? Compare this to the
difficulty of adding 6 new flush_dirty calls.
> I think you brought this up and I now think it is a good idea: calling
> gui_callback_finished after each event. For this we have to break up
> the main loop. This is possible for:
> - xaw: http://www.xfree86.org/4.2.0/XtAppNextEvent.3.html
> - gtk:
> http://developer.gnome.org/doc/API/gtk/gtk-general.html#GTK-MAIN-ITERATION
> - gtk2:
> http://developer.gnome.org/doc/API/2.0/gtk/gtk-General.html#gtk-main-iteration
>
> sdl, win32 and mui already have to loop broken up in the current
> source code.
I don't understand what you're saying. You want to break up the GUI's
main event loop, replacing gtk_main() with something like
while (!done) {
gtk_main_iteration();
flush_dirty();
}
? What if flush_dirty() itself generates a new GTK/GDK event? This is
again hideously expensive, and quite error-prone.
Or are you saying to break up the network loop by adding
flush_dirty();
while (gtk_events_pending()) {
gtk_main_iteration();
}
to be called every now and then? This is also hideously expensive (the
efficiency of the network operations is because they're done in
batches), and even more error-prone then the previous suggestions since
the network code is not re-entrant.
jason
- [Freeciv-Dev] (PR#3424) New flush code, Jason Short, 2003/02/24
- Message not available
- Message not available
- [Freeciv-Dev] Re: (PR#3424) New flush code, Raimar Falke, 2003/02/25
- Message not available
- Message not available
- [Freeciv-Dev] Re: (PR#3424) New flush code, Raimar Falke, 2003/02/25
- Message not available
- [Freeciv-Dev] Re: (PR#3424) New flush code, Jason Short, 2003/02/25
- Message not available
- [Freeciv-Dev] Re: (PR#3424) New flush code, Raimar Falke, 2003/02/26
- Message not available
- [Freeciv-Dev] Re: (PR#3424) New flush code,
Jason Short <=
- Message not available
- [Freeciv-Dev] Re: (PR#3424) New flush code, Raimar Falke, 2003/02/26
- Message not available
- [Freeciv-Dev] Re: (PR#3424) New flush code, Jason Short, 2003/02/26
- [Freeciv-Dev] Re: (PR#3424) New flush code, Raimar Falke, 2003/02/26
- [Freeciv-Dev] Re: (PR#3424) New flush code, Jason Short, 2003/02/27
- [Freeciv-Dev] Re: (PR#3424) New flush code, Raimar Falke, 2003/02/27
- [Freeciv-Dev] Re: (PR#3424) New flush code, Jason Short, 2003/02/27
- [Freeciv-Dev] Re: (PR#3424) New flush code, Rafał Bursig, 2003/02/27
- [Freeciv-Dev] Re: (PR#3424) New flush code, Jason Short, 2003/02/27
- [Freeciv-Dev] Re: (PR#3424) New flush code, Raimar Falke, 2003/02/28
- [Freeciv-Dev] Re: (PR#3424) New flush code, Jason Short, 2003/02/28
|
|