comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pogner.demon.co.uk>
Subject: Re: Rational APEX Ada95 w/ X11R6
Date: 1999/06/17
Date: 1999-06-17T00:00:00+00:00	[thread overview]
Message-ID: <x7vg13rjrkb.fsf@pogner.moho> (raw)
In-Reply-To: m3so7spj4t.fsf@mheaney.ni.net

Matthew Heaney <matthew_heaney@acm.org> writes:

> I think he is refering to the fact that in R6, you can run the X main
> loop inside its own thread.
> 
> How do you do this in Ada95?  In other words, how can you run the X main
> loop inside its own Ada task?
> 
> Does R6 specify what kind of thread runs the main loop?  I thought it
> specified a "Posix thread."  If so, how do you guarantee that an Ada
> task maps to a Posix thread?

It has always been possible to run the X main loop in a task (well, in
DEC VAX Ada 83, Sunsoft (VADS), GNAT on Solaris, Linux, OSF
anyway). The problems arise if you want other threads to access the
Display(s) that your main loop is controlling.

X11 doesn't have a main loop, does it? This an Xt function ..

> Stay away from thick bindings that "synchronize access so that calls are
> task-safe."  This doesn't work.  Stay away from thick bindings.  Stay
> away from bindings.

If you build X11R6 with threads enabled, which is the default on some
Linux platforms, and you initialize thread support in X and Xt, then
calls are task-safe.

> No.  All the C calls to X/Motif can be done by a thin C layer, called by
> a high-level infrastructure written in Ada95.  There's no need for Ada
> bindings to the toolkit directly.

Or you could rewrite the whole binding in Ada :-) I did this for (the
most interesting 25% of) X11R5 Xlib for Rational R1000 some years ago,
an interesting exercise but really only useful to make people sit up
and take notice.

-- 
Simon Wright                        Work Email: simon.j.wright@gecm.com
Alenia Marconi Systems                         Voice: +44(0)1705-701778
Integrated Systems Division                      FAX: +44(0)1705-701800




  parent reply	other threads:[~1999-06-17  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-15  0:00 Rational APEX Ada95 w/ X11R6 Brian Kelly
1999-06-15  0:00 ` dennison
1999-06-16  0:00   ` Matthew Heaney
1999-06-16  0:00     ` dennison
1999-06-16  0:00       ` Matthew Heaney
1999-06-16  0:00         ` dennison
1999-06-17  0:00     ` Simon Wright [this message]
1999-06-16  0:00 ` 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