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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,8b7e315279c3f417 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.180.74.79 with SMTP id r15mr3618988wiv.4.1356051620057; Thu, 20 Dec 2012 17:00:20 -0800 (PST) Path: i11ni239873wiw.0!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.130.MISMATCH!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newspeer1.nac.net!news.mi.ras.ru!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada Library, called, returns and continues ? Date: Sun, 16 Dec 2012 21:26:30 +0100 Organization: cbb software GmbH Message-ID: <1rz66cdo8v1hv.j9eyg9eqqide$.dlg@40tude.net> References: <5ced9166-5a29-4ad2-8270-6d24ddd0d0a1@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: kWJV5lTRAyCzy8lsfOrlcw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-12-16T21:26:30+01:00 List-Id: On Sun, 16 Dec 2012 11:21:16 -0800 (PST), Patrick wrote: > I don't want the GUI to block and I want the freedom to use Ada's > threading model without too many restrictions. This is understandable > I keep changing my mind but today I looking into the Fox Toolkit. I am > thinking about writing a single threaded C++ or Ruby application and then > calling Ada from it. Why not to use something more Ada friendly? Anyway, single threaded GUI means what? One thread = blocking. > If I write and compile an Ada library into my > GUI app, is it possible to call an Ada function, have it return quickly > but then have Ada code continue to execute using threading? Surely, but that would not be single-threaded anymore. > Honestly I have not used Ada's threading yet You should > but could the GUI call an > entry, perhaps after an initialization call to start the threads? Yes, this is rather trivial. But you also need a communication channel back to the GUI thread = asynchronous access to the GUI events, messages whatever. E.g. a working task which modifies a GUI's progress bar as it does the job. It is more than just starting tasks. There are various solutions for this which always depend on the GUI framework at hand. I have no idea about the Fox Toolkit. You should find out ways of doing this there. Usually, when the framework is not natively multi-tasking, you use polling, timer events, idle callbacks to implement the backward channel (task to the main messages loop). -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de