From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d38d76f108979fc7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-27 06:05:03 PST From: Manuel Carro Newsgroups: comp.lang.ada Subject: Re: Problem with gtkada and tasks Date: 27 Jul 2001 14:31:34 +0200 Organization: Computer Science Department, Technical U. of Madrid, Spain Message-ID: <7s8zhah7tl.fsf@salmon.ls.fi.upm.es> References: <3b5e88ee.10782754@news.bt.es> <3b612332.907204@news.bt.es> NNTP-Posting-Host: salmon.ls.fi.upm.es X-Trace: panoramix.fi.upm.es 996237095 29060 138.100.10.4 (27 Jul 2001 12:31:35 GMT) X-Complaints-To: news@panoramix.fi.upm.es NNTP-Posting-Date: 27 Jul 2001 12:31:35 GMT X-Newsreader: Gnus v5.7/Emacs 20.7 Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!130.59.214.20!news-ge.switch.ch!news.rediris.es!news-2.rediris.es!138.100.251.9.MISMATCH!news.upm.es!panoramix.fi.upm.es!not-for-mail Xref: archiver1.google.com comp.lang.ada:10637 Date: 2001-07-27T12:31:35+00:00 List-Id: > Until t has not completed its execution, the windows do not update. > (and in the body of the task type cell it updates the window, but it > does not appear in screen after the tasks have died). I am not sure of having understood fully your problem, but the contents of the windows are updated by the Gtk.Main.Main or Gtk.Main.Main_Iteration procedures. If you call the former from inside a handler, then this is probably a mistake: the GtkAda documentation states that: the GtkAda main loop (Gtk.Main.Main) can only be be run inside one specific tasks. In other words, you cannot call Gtk.Main.Main from any task other than the one that started the outer level main loop. If you have another task receiving events, etc, then you should protect the access to the graphical primitives (cf. the GtkAda documentation). In any case, the Ada task semantics, AFAIK, does not require a task relinquishing the CPU unless blocked (i.e., no round-robin by default). But, on the other hand, I have found (in Linux) some problems when using concurrently the GtkAda toolkit, even using Gtk.Threads. A safe solution (which is the one I adopted) is to access all the graphical primitives from a task which initializes the state and has a delay clause which periodically updates the windows. Any smarter solution will be welcome. -- || Manuel Carro -- DLSIIS || || e-mail: mcarro@fi.upm.es || || http://lml.ls.fi.upm.es/~boris || || http://clip.dia.fi.upm.es/Software/Ciao || || Phone: +34 91 336-7455 FAX: +34 91 336-7412 ||