[gtkada] GtkAda and tasking

Jean-Pierre Rosen rosen.adalog at wanadoo.fr
Tue Apr 18 17:30:10 CEST 2000


> You can in fact rewrite the main loop yourself, with something like
(extract
> from the GtkAda documentation, package Gtk.Main):
>
>    loop
>       --  test entries
>       ...
>
>       --  process events
>       while Gtk.Main.Events_Pending loop
>           Dead := Gtk.Main.Main_Iteration;
>       end loop;
>    end loop;
>
> Is this good enough for you ?
>
No. That's exactly what I want to avoid. Because, when I'm not processing
events, I'll need a select to accept communications from other tasks, and if
I stay blocked at the select, events won't be processed any more. Of course
I could add an "or delay" to the select to go and check for events, but then
I fall into the active polling that I'm trying to avoid.

My idea was that the client would make a call to some magic routine to force
the UI task out of the main loop, so that it would accept a communication
ONLY when there is a request pending (and therefore would never block in the
select).
---------------------------------------------------------
           J-P. Rosen (Rosen.Adalog at wanadoo.fr)
Visit Adalog's web site at http://pro.wanadoo.fr/adalog






More information about the gtkada mailing list