comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Ada Library, called, returns and continues ?
Date: Sun, 16 Dec 2012 21:26:30 +0100
Date: 2012-12-16T21:26:30+01:00	[thread overview]
Message-ID: <1rz66cdo8v1hv.j9eyg9eqqide$.dlg@40tude.net> (raw)
In-Reply-To: 5ced9166-5a29-4ad2-8270-6d24ddd0d0a1@googlegroups.com

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



  parent reply	other threads:[~2012-12-16 20:26 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-16 19:21 Ada Library, called, returns and continues ? Patrick
2012-12-16 19:51 ` Simon Wright
2012-12-16 20:26 ` Dmitry A. Kazakov [this message]
2012-12-16 23:13   ` Patrick
2012-12-17  8:59     ` Dmitry A. Kazakov
2012-12-17 15:58       ` Patrick
2012-12-17 17:08         ` Simon Wright
2012-12-17 17:43           ` Patrick
2012-12-17 18:09         ` Dmitry A. Kazakov
2012-12-17 19:41           ` Patrick
2012-12-17 21:26             ` Dmitry A. Kazakov
2012-12-17 23:42               ` Patrick
2012-12-18  0:30                 ` Randy Brukardt
2012-12-18  1:36                   ` Patrick
2012-12-18 23:10                     ` Randy Brukardt
2012-12-18  9:17                 ` Dmitry A. Kazakov
2012-12-18 15:00                   ` Patrick
2012-12-18 15:37                     ` Dmitry A. Kazakov
2012-12-18 16:14                       ` Patrick
2012-12-18 17:25                         ` Dmitry A. Kazakov
2012-12-18 16:50                   ` Robert A Duff
     [not found]                 ` <2nr1d89tvkc3h0dvcd62tpsf1vujsdb09o@invalid.netcom.com>
2012-12-18 23:54                   ` Patrick
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox