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,230344565f3fdda8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-14 10:10:05 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!msc1.onvoy!onvoy.com!snoopy.risq.qc.ca!torn!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Message-ID: <3DD3E478.8000407@cogeco.ca> From: "Warren W. Gay VE3WWG" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: multithreading with gtkada References: <3DD3D67A.3060302@cnam.fr> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 14 Nov 2002 12:59:20 -0500 NNTP-Posting-Host: 198.96.47.195 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1037296761 198.96.47.195 (Thu, 14 Nov 2002 12:59:21 EST) NNTP-Posting-Date: Thu, 14 Nov 2002 12:59:21 EST Organization: Bell Sympatico Xref: archiver1.google.com comp.lang.ada:30891 Date: 2002-11-14T12:59:20-05:00 List-Id: evangeli wrote: > hi all > > it seems that gtk doesnt support multi-threading (see > http://www.faqs.org/faqs/x-faq/part7/section-15.html). I believe that Gtk does support tasks, but on UNIX platforms, Gtk will make use of the Xlib (as the ref above shows). This library I believe is now thread safe on _some_ platforms, but most certainly NOT on all of them. I would certainly not depend upon it for portable code. > My problem is the following : > my app opens a windows, which on the show event launch a task wich makes > a long computation. The window also contains a cancel button which can > be pressed to abort this task.The problem is that i would like this task > to make X-Call, and that is apparently not possible and give me > unavoidably the following error message: > ---------------------------------------------- > Xlib: unexpected async reply (sequence 0x9fe)! > ---------------------------------------------- > i havent found any solution which doesn't use several tasks. > > 1) Am i clear? > 2) Do u have any idea of a different way to do that? > 3) why this cruel destiny? > > thanks for any response Your problem requires some careful Ada programming. You will need to segment your application so that one or the following approaches are used: - Only one task does Gtk (GUI) operations or - You use an Ada technique to make certain that only one Ada task is doing a Gtk operation at any given instance (protected objects perhaps). Sounds like you need the second approach. You can run into the same situations when trying to use curses (text mode screens). -- Warren W. Gay VE3WWG http://home.cogeco.ca/~ve3wwg