comp.lang.ada
 help / color / mirror / Atom feed
From: Des Walker <des.walker@amsjv.com>
Subject: Re: Using Xt intrinsics with Ada?
Date: Fri, 02 Feb 2001 16:08:03 +0000
Date: 2001-02-02T16:08:03+00:00	[thread overview]
Message-ID: <3A7ADB63.55BAA625@amsjv.com> (raw)
In-Reply-To: 3A78357A.2BD8C0B1@avitech.de

J�rgen Grigat wrote:
> 
> Hi,
> 
> we are developing a program in Ada that has connections to other processes by
> sockets. The calls are done in Ada by using interfaces to C library functions.
> In order to avoid polling we wonder if we can use the event mechanism of X
> Toolkit  Intrinsics. So we created a task which is calling a C-routine that
> itself calls XtAppMainLoop. The main program is an Ada routine.
> From the functional point of view this seems to work. But we recognize a heavy
> CPU load even there is no traffic at the connection.
> 
> Has anyone experience in using X Toolkit events in Ada tasking programs?
> 
> Thanks for any hints.
> 
> J�rgen

Hi J�rgen,

  Just to throw a bit more into the melting pot. We have some
applications using Xt and Ada and don't seem to have had the problem you
describe. It may depend what level of load you mean by a heavy CPU load.

The first issue of our application was built using a Verdix Ada83
compiler and ran on a SPARC5 processor. Multithreading X wasn't
available so we used XtAppAddInput to allow external messages to be
processed in the context of the Main Loop (some messages required an
update to the displayed picture). In the end we settled for separate Ada
tasks to handle the Inet sockets, which queued all their messages on a
single Unix domain socket. It was only the Unix domain socket which was
monitored by Xt. I think the application base load on this processor was
10% of the CPU which was put down to act of maintaining the displayed
picture.

We've subsequently migrated to GNAT Ada and SPARC 50s whilst keeping the
same use of Xt, and the base load has reduced consistently (ie < 1%).

I recall from doing some profiling of the application that the select
function was one of the highest CPU users - In our case, the select
service was the underlying mechanism used by Xt to monitor inputs. I see
others have suggested using select to monitor your sockets, but you may
find that this is what Xt is doing already.

In summary, it's not obvious that the combination of Ada and Xt should
be a problem. I don't know if you have tried profiling your application,
but that may give you some insight as to where the problem lies.

	Des Walker
	Alenia-Marconi Systems



  parent reply	other threads:[~2001-02-02 16:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-31 15:55 Using Xt intrinsics with Ada? Jürgen Grigat
2001-01-31 18:14 ` Stephen Leake
2001-02-02  9:58   ` Juergen Fischer
2001-02-02 12:00     ` Jeff Creem
2001-02-02 15:02     ` Ted Dennison
2001-02-02 15:43       ` Juergen Fischer
2001-02-02 19:30         ` Ted Dennison
2001-02-02 15:06     ` Stephen Leake
2001-02-02 15:48       ` Juergen Fischer
2001-02-05 15:06         ` Stephen Leake
2001-02-02 15:21     ` Robert Dewar
2001-01-31 19:19 ` Ted Dennison
2001-01-31 21:07   ` Ted Dennison
2001-01-31 21:40     ` Mario Klebsch
2001-02-02 16:26       ` Juergen Fischer
2001-01-31 19:42 ` Kevin Kronmiller
2001-02-01 11:55 ` Tarjei T. Jensen
2001-02-02 16:08 ` Des Walker [this message]
2001-02-02 16:40   ` Juergen Fischer
2001-02-03 14:37     ` Simon Wright
replies disabled

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